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

GH-5768: Better pyflyte boolean parsing #2764

Conversation

Tom-Newton
Copy link
Contributor

@Tom-Newton Tom-Newton commented Sep 23, 2024

Tracking issue

Closes flyteorg/flyte#999

Why are the changes needed?

The current boolean parsing behaviour is confusing for default True arguments.

What changes were proposed in this pull request?

Add --no_... and --no-... variants for boolean flags as per the recommendation at https://click.palletsprojects.com/en/8.1.x/options/#boolean-flags

How was this patch tested?

Wrote new unit tests to cover it.

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly - I'm not aware of any docs that need updating. pyflyte's --help should be automatically taken care of by the click library.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
@Tom-Newton Tom-Newton force-pushed the tomnewton/better_pyflyte_boolean_parsing/GH-5768 branch from a0fe865 to 65807ff Compare September 23, 2024 15:48
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
@Tom-Newton Tom-Newton force-pushed the tomnewton/better_pyflyte_boolean_parsing/GH-5768 branch from b844fa3 to 604f07c Compare September 23, 2024 16:10
Copy link
Collaborator

@eapolinario eapolinario left a comment

Choose a reason for hiding this comment

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

Thank you. This makes sense. I have only one small comment.

flytekit/clis/sdk_in_container/run.py Outdated Show resolved Hide resolved
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
@Tom-Newton Tom-Newton force-pushed the tomnewton/better_pyflyte_boolean_parsing/GH-5768 branch from 0cad3a5 to 34466a3 Compare September 23, 2024 20:06
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.13%. Comparing base (94786cf) to head (34466a3).

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2764       +/-   ##
===========================================
+ Coverage   78.98%   92.13%   +13.14%     
===========================================
  Files         194       19      -175     
  Lines       19807     1309    -18498     
  Branches     4130        0     -4130     
===========================================
- Hits        15645     1206    -14439     
+ Misses       3443      103     -3340     
+ Partials      719        0      -719     
Flag Coverage Δ
92.13% <ø> (+13.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

pingsutw
pingsutw previously approved these changes Sep 23, 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.

There is a lint error. otherwise LGTM

Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
@eapolinario eapolinario enabled auto-merge (squash) September 23, 2024 20:59
@eapolinario eapolinario merged commit 5643915 into flyteorg:master Sep 23, 2024
103 checks passed
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.

[BUG] Confusing behaviour with default True boolean arguments when using pyflyte run
3 participants