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

291 error initializing scheduler on spin #292

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

mbthornton-lbl
Copy link
Contributor

This PR provides a fix for:

#291

Error:

File "/src/nmdc_automation/workflow_automation/workflow_process.py", line 31, in get_required_data_objects_map
    if do.data_object_type.code.text not in required_types:
AttributeError: 'NoneType' object has no attribute 'code'

get_required_data_objects_map was doing a find on the data_object_set with no filters. Some data objects do not have a data_object_type, which led to the AttributeError

Fix is to filter out data objects without a type

        for wf in workflows:
            required_types.update(set(wf.data_object_types))

        required_data_objs_by_id = dict()
        for rec in db.data_object_set.find():
            do = DataObject(**rec)
>           if do.data_object_type.code.text not in required_types:
E           AttributeError: 'NoneType' object has no attribute 'code'
@mbthornton-lbl mbthornton-lbl linked an issue Nov 20, 2024 that may be closed by this pull request
@mbthornton-lbl mbthornton-lbl requested a review from aclum November 20, 2024 00:34
@mbthornton-lbl mbthornton-lbl merged commit 090b73b into main Nov 20, 2024
1 check passed
@mbthornton-lbl mbthornton-lbl deleted the 291-error-initializing-scheduler-on-spin branch November 20, 2024 00:57
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 this pull request may close these issues.

Error initializing Scheduler on Spin
2 participants