cisaacstern commented on PR #27618:
URL: https://github.com/apache/beam/pull/27618#issuecomment-1773849886

   Ok, narrowing in on the issue here! Looks like this _does_ relate to the "to 
cast to list or not to cast to list" discussion I had with myself starting in 
https://github.com/apache/beam/pull/27618#discussion_r1357577926. As shown 
here, _not_ casting to list results in no computation actually happening:
   
   ```python
   # bag.py
   
   import dask.bag as db
   import distributed as ddist
   
   bag = db.from_sequence([1])
   bag_dict = {"bag": bag}
   
   if __name__ == "__main__":
       with ddist.Client() as c:
           bag_result = c.gather(c.compute(bag))
           print(f"{bag_result=}")
   
           dict_vals_result = c.gather(c.compute(bag_dict.values()))
           print(f"{dict_vals_result=}")
   
           dict_vals_to_unpacked_list_result = 
c.gather(c.compute(*list(bag_dict.values())))
           print(f"{dict_vals_to_unpacked_list_result=}")
   ```
   ```console
   ➜ python bag.py
   bag_result=[1]
   dict_vals_result=dict_values([dask.bag<from_sequence, npartitions=1>])
   dict_vals_to_unpacked_list_result=[1]
   ```
   So looks like casting to list is definitely the way to go. I think I backed 
off that change because it caused a serialization issue (which caused tests to 
fail). So I'll re-implement the list casting now and re-examine what that 
serialization issue was, and report back.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to