fix: handle null parent nodes in apply_templated_fields#214
Merged
Conversation
When a job has job_completion_trigger_condition set to null and --templated-fields includes a dotted path into that field (e.g. job_completion_trigger_condition.condition.project_id), set_nested_value would crash with TypeError because it tried to check membership in None. Treat null parent nodes the same as missing keys by replacing them with an empty dict before navigating further.
Contributor
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
apply_templated_fieldscrashed withTypeError: argument of type 'NoneType' is not iterablewhen a job hadjob_completion_trigger_condition: nulland--templated-fieldsincluded a dotted path into that field (e.g.job_completion_trigger_condition.condition.project_id)Context
Triggered when users template nested fields in the job completion trigger condition across multi-environment migrations, where some jobs have
job_completion_trigger_condition: nulland others do not.Test plan
uv run pytest tests/exporter/test_export.py— all 10 tests passimport-jobs --templated-fieldswith a template that includesjob_completion_trigger_condition.condition.project_idagainst an account that has a mix of jobs with and without a job completion trigger condition