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

Raise an exception when filters' value isn't a list. #2576

Merged
merged 7 commits into from
Aug 5, 2024

Conversation

arbaobao
Copy link
Contributor

@arbaobao arbaobao commented Jul 10, 2024

Why are the changes needed?

What changes were proposed in this pull request?

How was this patch tested?

Setup process

  • Ran a remote.recent_executions() with filters using list or other types.
from flytekit.configuration import Config
from flytekit.models.filters import ValueIn, Contains
from flytekit.remote import FlyteRemote

remote = FlyteRemote(
    Config.auto(config_file="/home/nelson/.flyte/config-sandbox.yaml"),
    default_project="flytesnacks",
    default_domain="development",
)

executions = remote.recent_executions(
        project="flytesnacks",
        domain="development",
        limit=1,
        filters=[
            ValueIn("phase", "RUNNING"),
        ],
)

Screenshots

image

image

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Copy link

welcome bot commented Jul 10, 2024

Thank you for opening this pull request! 🙌

These tips will help get your PR across the finish line:

  • Most of the repos have a PR template; if not, fill it out to the best of your knowledge.
  • Sign off your commits (Reference: DCO Guide).

Copy link

codecov bot commented Jul 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 76.19%. Comparing base (72da0d0) to head (e6bb844).

Files Patch % Lines
flytekit/models/filters.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2576      +/-   ##
==========================================
- Coverage   78.77%   76.19%   -2.58%     
==========================================
  Files         187      187              
  Lines       19149    19151       +2     
  Branches     3993     3994       +1     
==========================================
- Hits        15085    14593     -492     
- Misses       3374     3899     +525     
+ Partials      690      659      -31     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Nelson Chen <asd3431090@gmail.com>
@eapolinario
Copy link
Collaborator

Can you add a unit test?

Signed-off-by: Nelson Chen <asd3431090@gmail.com>
@thomasjpfan
Copy link
Member

@arbaobao This is not signed off yet. You can find instructions on how to sign off here: https://github.com/flyteorg/flytekit/pull/2576/checks?check_run_id=28277359939

@pingsutw
Copy link
Member

pingsutw commented Aug 2, 2024

@arbaobao there is a linting error, could you run make lint locally and push it again?

pingsutw
pingsutw previously approved these changes Aug 3, 2024
Copy link
Member

@pingsutw pingsutw left a comment

Choose a reason for hiding this comment

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

lgtm

Signed-off-by: Kevin Su <pingsutw@apache.org>
@thomasjpfan thomasjpfan merged commit fecd41c into flyteorg:master Aug 5, 2024
97 checks passed
Copy link

welcome bot commented Aug 5, 2024

Congrats on merging your first pull request! 🎉

Future-Outlier pushed a commit that referenced this pull request Aug 6, 2024
* Add an exeception when filters' value isn't a list

* Make the exception more specific

Signed-off-by: Nelson Chen <asd3431090@gmail.com>

* add an unit test for value_in

Signed-off-by: Nelson Chen <asd3431090@gmail.com>

* lint

Signed-off-by: Kevin Su <pingsutw@apache.org>

---------

Signed-off-by: Nelson Chen <asd3431090@gmail.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Co-authored-by: Kevin Su <pingsutw@apache.org>
mao3267 pushed a commit to mao3267/flytekit that referenced this pull request Aug 9, 2024
* Add an exeception when filters' value isn't a list

* Make the exception more specific

Signed-off-by: Nelson Chen <asd3431090@gmail.com>

* add an unit test for value_in

Signed-off-by: Nelson Chen <asd3431090@gmail.com>

* lint

Signed-off-by: Kevin Su <pingsutw@apache.org>

---------

Signed-off-by: Nelson Chen <asd3431090@gmail.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Co-authored-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: mao3267 <chenvincent610@gmail.com>
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.

4 participants