fix: prevent runs filter from accepting an empty list of run ids #7217
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
Currently, applying a run filter with
run_ids
asNone
or[]
has the same result of fetching all the runs. This is because both values are falsey.We could change the logic to treat
[]
as a short-circuit and skip fetching any runs, but then the API consumer would need to be wary that passing in[]
has this particular behavior.Instead, if
[]
is passed in, throw an error. The API consumer should explicitly guard for this case in their business logic, rather than relying on the underlying API to skip the fetching of any runs.Test Plan
pytest
run dagit locally, fill out
id:
field with random valuesScreen.Recording.2022-03-28.at.2.46.46.PM.mov