Using mergeBatch in platform Python function call


#1

The following code works in my jupyter notebook (connected to a C3 environment)
c3.MyType.mergeBatch([{"id":"A"}, {"id":"B"}])

However, when I put the same code in a .py file and call it through C3 type, I got the following error:

"Error executing command: XXXXX.py
Traceback (most recent call last):
  File "XXXXX.py", line 346, in <module>
    _c3_result = XXXXX()
  File "XXXXX.py", line 342, in XXXX
    c3.MyType.mergeBatch([{"id":"AA"}, {"id":"BB"}])
TypeError: __call__() takes exactly 1 argument (2 given)
"

Why?


#2

Try
c3.MyType.mergeBatch(objs = [{"id":"A"}, {"id":"B"}])

You have to provide every argument name in the python function call to the platform.

Checkout c3ShowType(Persistable) for arugment names for merge, mergeBatch, upsert, upsertBatch, create, createBatch, and etc