这是indexloc提供的服务,不要输入任何密码
Skip to content

Question: How to pass tuples with dicts? #15

@singlecheeze

Description

@singlecheeze

I'm trying to pass a list (of one) tuple that has a dict with some values to a function that just passes the input arg back. Empty dicts work, but populated dicts do not (aware of mutability nuances):

def do_something(row):
    return row

tups = [('STOCK', {'opens': [99, 100], 'closes': [100, 101]})]

c = Context(webui=False)
out = c.parallelize(tups).map(do_something).collect()

Error:

File "/usr/local/lib64/python3.9/site-packages/tuplex/context.py", line 163, in parallelize
    ds._dataSet = self._context.parallelize(value_list, columns, schema)
IndexError: map::at

Is there a better way to do this?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions