Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pipelines/assets/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,12 @@ def consolidated_fixture(
if model_name != "WealthGroup"
},
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Would this be better as:

    # Add the wild foods and other cash income instances, if they are present
    for model_name, instances in {**other_cash_income_valid_instances, **wild_foods_valid_instances}.items():
        if instances and model_name != "WealthGroup":
            if model_name not in consolidated_instances:
                consolidated_instances[model_name] = []
            consolidated_instances[model_name] += instances

That way, if we ever have to add additional models in the future it will still work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, agreed. Pushed the updates

# Add the wild foods and other cash income instances, if they are present
for model_name, instances in {**other_cash_income_valid_instances, **wild_foods_valid_instances}.items():
if instances and model_name != "WealthGroup":
if model_name not in consolidated_instances:
consolidated_instances[model_name] = []
consolidated_instances[model_name] += instances

fixture, metadata = get_fixture_from_instances(consolidated_instances)
Expand Down