Skip to content

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

Merged
thomasjpfan merged 7 commits into
flyteorg:masterfrom
arbaobao:master
Aug 5, 2024
Merged

Raise an exception when filters' value isn't a list.#2576
thomasjpfan merged 7 commits into
flyteorg:masterfrom
arbaobao:master

Conversation

@arbaobao

@arbaobao arbaobao commented Jul 10, 2024

Copy link
Copy Markdown
Contributor

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

@welcome

welcome Bot commented Jul 10, 2024

Copy link
Copy Markdown

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).

@codecov

codecov Bot commented Jul 10, 2024

Copy link
Copy Markdown

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.

Comment thread flytekit/models/filters.py Outdated
Signed-off-by: Nelson Chen <asd3431090@gmail.com>
@eapolinario

Copy link
Copy Markdown
Collaborator

Can you add a unit test?

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

Copy link
Copy Markdown
Contributor

@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

pingsutw commented Aug 2, 2024

Copy link
Copy Markdown
Member

@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

@pingsutw pingsutw left a comment

Copy link
Copy Markdown
Member

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
@welcome

welcome Bot commented Aug 5, 2024

Copy link
Copy Markdown

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