Skip to content

on_task bugfix. Refs https://github.com/doe-iri/iri-facility-api-pyth…#58

Merged
gabor-lbl merged 2 commits intomainfrom
task_fix
Mar 4, 2026
Merged

on_task bugfix. Refs https://github.com/doe-iri/iri-facility-api-pyth…#58
gabor-lbl merged 2 commits intomainfrom
task_fix

Conversation

@gabor-lbl
Copy link
Contributor

…on/issues/52

# Returns: (result, status)
def _extractNull(ind):
data = {k: v for k, v in ind.items() if v is not None}
data = {k: v for k, v in ind.model_dump().items() if v is not None}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe safer like this:

def _extractNull(ind):
    if hasattr(ind, "model_dump"):
        data = ind.model_dump()
    else:
        data = ind
    return {k: v for k, v in data.items() if v is not None}

@gabor-lbl gabor-lbl merged commit 0bd74e3 into main Mar 4, 2026
1 check passed
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.

2 participants