-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Improve error handling in cli and introduce consistency #12764
Conversation
This PR is a followup after apache#12375 and apache#12704 it improves handling of some errors in cli commands to avoid show users to much traceback and uses SystemExit consitently.
if uri_parts.scheme == '' or uri_parts.netloc == '': | ||
return False | ||
return True | ||
return uri_parts.scheme != '' or uri_parts.netloc != '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be changed into uri_parts.scheme != '' and uri_parts.netloc != ''
, instinct from a math-major guy ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, De Morgan's laws - and I did a thesis from fuzzy logic 🤦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha, only now I know you also majored in math😄 My focus was random process and application in bio-stats.
But anyway, not rare for math people like us to miss OR/AND time to time😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the minor one in my comment below, LGTM
@@ -95,7 +96,7 @@ def _import_helper(filepath): | |||
fail_count += 1 | |||
else: | |||
suc_count += 1 | |||
print("{} of {} variables successfully updated.".format(suc_count, len(var_json))) | |||
print(f"{suc_count} of {len(var_json)} variables successfully updated.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From other changes I had the impression that "removing following period" is one of the the points you are enforcing in this PR. Maybe you missed this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried, but then I resigned because I'm not sure what's better:
some text and 6
orsome text and 6.
some 'text'=value
orsome 'text'=value.
some /text/and/path
orsome /text/and/path.
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest master or amend the last commit of the PR, and push it with --force-with-lease. |
I'm good with it 👍 |
This PR is a followup after #12375 and #12704 it improves handling
of some errors in cli commands to avoid show users to much traceback
and uses SystemExit consistently.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.