Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 8, 2026

The override_filters field in replace_obs_filters was defaulting to an empty dict {} instead of an empty list [], and values retrieved from the template dictionary (potentially wxflow attrdicts) were not being converted to plain Python dicts.

Changes

  • Added to_plain_dict() utility function: Recursively converts dict-like objects (e.g., wxflow attrdict) and nested structures to plain Python dicts
  • Changed default value: override_filters now defaults to [] instead of {}
  • Applied conversion: All retrieved override_filters values are converted via to_plain_dict() to ensure consistent plain dict types throughout nested structures
# Before
new_filters = replace_obs_filters_dict.get('override_filters', {})

# After
new_filters = replace_obs_filters_dict.get('override_filters', [])
new_filters = to_plain_dict(new_filters)

The conversion handles arbitrary nesting depth and preserves list structures containing dicts.

Original prompt

This section details on the original issue you should resolve

<issue_title>Replacement filters should be a list + make plain dict</issue_title>
<issue_description>

new_filters = replace_obs_filters_dict.get('override_filters', {})

This line should end with [] not {} and also the list of dicts needs to be forced to be plain, vanilla dicts and not wxflow attrdict. Maybe?</issue_description>

Comments on the Issue (you are @copilot in this section)

@CoryMartin-NOAA Needs to nest in and convert to plain dicts also... perhaps something else is going on.??

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix replacement filters to use list and plain dicts Fix replacement filters default value and ensure plain dict conversion Jan 8, 2026
Copilot AI requested a review from CoryMartin-NOAA January 8, 2026 20:30
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.

Replacement filters should be a list + make plain dict

2 participants