Skip to content
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

lpad recover_offline doesn't work with pymongo>3.13.0 #515

Open
JosephMontoya-TRI opened this issue Nov 15, 2023 · 0 comments
Open

lpad recover_offline doesn't work with pymongo>3.13.0 #515

JosephMontoya-TRI opened this issue Nov 15, 2023 · 0 comments

Comments

@JosephMontoya-TRI
Copy link

JosephMontoya-TRI commented Nov 15, 2023

When I use lpad recover_offline in v2.0.3 (with pymongo==4.6.0):

Traceback (most recent call last):
  File "/home/a30107/atomate/bin/lpad", line 33, in <module>
    sys.exit(load_entry_point('FireWorks', 'console_scripts', 'lpad')())
  File "/lustre0/home/a30107/atomate/lib/python3.9/site-packages/FireWorks-2.0.3-py3.9.egg/fireworks/scripts/lpad_run.py", line 1551, in lpad
    args.func(args)
  File "/lustre0/home/a30107/atomate/lib/python3.9/site-packages/FireWorks-2.0.3-py3.9.egg/fireworks/scripts/lpad_run.py", line 767, in recover_offline
    if fworker_name and lp.launches.count({"launch_id": l["launch_id"], "fworker.name": fworker_name}) == 0:
  File "/lustre0/home/a30107/atomate/lib/python3.9/site-packages/pymongo/collection.py", line 3166, in __call__
    raise TypeError(
TypeError: 'Collection' object is not callable. If you meant to call the 'count' method on a 'Collection' object it is failing because no such method exists.

I think this is just because Collection.count is deprecated. I think the fix should be straightforward, just update the second condition on line 767 of lpad_run.py to use the more recent method of counting documents. Wanted to raise the issue just in case it falls off my radar and I don't have time to issue a proper fix.

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

No branches or pull requests

1 participant