Skip to content

Error executing multiprocessing example #578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
apogre opened this issue May 24, 2023 · 2 comments · Fixed by #664
Closed

Error executing multiprocessing example #578

apogre opened this issue May 24, 2023 · 2 comments · Fixed by #664
Assignees
Milestone

Comments

@apogre
Copy link

apogre commented May 24, 2023

examples/import_data_set_multiprocessing.py

https://github.com/influxdata/influxdb-client-python/blob/master/examples/import_data_set_multiprocessing.py

Error executing multiprocessing example are reactivex upgrade.

 Unexpected error: 'Future' object is not iterable
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/reactivex/observable/observable.py", line 125, in set_disposable
    subscriber = self._subscribe_core(auto_detach_observer, scheduler)
  File "/usr/local/lib/python3.9/site-packages/reactivex/observable/observable.py", line 49, in _subscribe_core
    return self._subscribe(observer, scheduler) if self._subscribe else Disposable()
  File "/usr/local/lib/python3.9/site-packages/reactivex/observable/fromiterable.py", line 31, in subscribe
    iterator = iter(iterable)
TypeError: 'Future' object is not iterable
@mecod
Copy link

mecod commented Jul 26, 2024

Same error.
After change
ops.flat_map(lambda rows: executor.submit(parse_rows, rows, content_length)))
to
ops.map(lambda rows: executor.submit(parse_rows, rows, content_length)))
it works now.

Reference
FlatMap — transform the items emitted by an Observable into Observables, then flatten the emissions from those into a single Observable
Map — transform the items emitted by an Observable by applying a function to each item

@bednar
Copy link
Contributor

bednar commented Jul 26, 2024

@mecod, @apogre thanks for report this. We will take a look.

@bednar bednar assigned bednar and unassigned karel-rehor Aug 12, 2024
@bednar bednar added this to the 1.46.0 milestone Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants