Skip to content

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

@JosephMontoya-TRI

Description

@JosephMontoya-TRI

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.

Metadata

Metadata

Assignees

No one assigned

    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