-
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
[AIRFLOW-2227] Add delete method to Variable class #4963
Conversation
airflow/bin/cli.py
Outdated
@@ -343,7 +343,7 @@ def variables(args): | |||
print(e) | |||
if args.delete: | |||
with db.create_session() as session: |
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.
We can remove the create_session here.
Codecov Report
@@ Coverage Diff @@
## master #4963 +/- ##
==========================================
+ Coverage 75.74% 75.74% +<.01%
==========================================
Files 458 458
Lines 29850 29853 +3
==========================================
+ Hits 22609 22612 +3
Misses 7241 7241
Continue to review full report at Codecov.
|
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.
Thanks @jmsanders
Make sure you have checked all steps below.
Jira
My PR addresses the following Airflow Jira issues and references them in the PR title.
Description
Add a delete method to the Variable class that no-ops if the Variable already does not exist. Additionally, refactor usages of
session.query(Variable).filter(key).delete()
to use the newVariable.delete(key)
instead.Tests
My PR adds the following unit tests OR does not need testing for this extremely good reason:
tests.core:CoreTest.test_variable_delete
Commits
Documentation
Code Quality
flake8