Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent runs filter from accepting an empty list of run ids #7217

Merged

Conversation

rexledesma
Copy link
Member

@rexledesma rexledesma commented Mar 28, 2022

Summary

Currently, applying a run filter with run_ids as None 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 values

Screen.Recording.2022-03-28.at.2.46.46.PM.mov

@linear
Copy link

linear bot commented Mar 28, 2022

CLOUD-1165 Throw an error if runs filter is given an empty list of run ids

Currently, applying a run filter with run_ids as None 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.

@vercel
Copy link

vercel bot commented Mar 28, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

dagit-storybook – ./js_modules/dagit/packages/ui

🔍 Inspect: https://vercel.com/elementl/dagit-storybook/7Uxy1SjNtYytAfWdJ2He3KAoqJKy
✅ Preview: Canceled

[Deployment for 77c483b canceled]

dagster – ./docs/next

🔍 Inspect: https://vercel.com/elementl/dagster/3H9k29ejHqWbVuL7mbosgVKR9x2B
✅ Preview: Canceled

[Deployment for 77c483b canceled]

@vercel vercel bot temporarily deployed to Preview – dagit-storybook March 28, 2022 20:54 Inactive
@vercel vercel bot temporarily deployed to Preview – dagster March 28, 2022 20:54 Inactive
@rexledesma
Copy link
Member Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@rexledesma rexledesma requested review from alangenfeld, gibsondan and a team March 28, 2022 20:54
@rexledesma rexledesma self-assigned this Mar 28, 2022
Copy link
Member

@alangenfeld alangenfeld left a comment

Choose a reason for hiding this comment

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

Test Plan
pytest

can you do a quick sanity check in dagit to make sure you can't get this fire messing around with filters in the runs page?

@rexledesma
Copy link
Member Author

rexledesma commented Mar 28, 2022

Test Plan
pytest

can you do a quick sanity check in dagit to make sure you can't get this fire messing around with filters in the runs page?

Locally verified this behavior and added a video. Though funny enough, found an unrelated error when doing this manual test (#7219).

@rexledesma rexledesma force-pushed the rex/cloud-1165-throw-an-error-if-runs-filter-is-given branch from c64188d to 77c483b Compare March 28, 2022 22:43
@vercel vercel bot temporarily deployed to Preview – dagster March 28, 2022 22:43 Inactive
@vercel vercel bot temporarily deployed to Preview – dagit-storybook March 28, 2022 22:43 Inactive
Copy link
Member

@alangenfeld alangenfeld left a comment

Choose a reason for hiding this comment

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

thanks

@rexledesma rexledesma merged commit 7abf706 into master Mar 29, 2022
@rexledesma rexledesma deleted the rex/cloud-1165-throw-an-error-if-runs-filter-is-given branch March 29, 2022 16:07
johannkm added a commit that referenced this pull request Jun 15, 2022
A side effect of #7217 is that you can't serialize and deserialize runsfilters. I'm not sure where else we do that but I ran in to it for bulk action stuff

Is there a better way to hack this?
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