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

[AIRFLOW-2227] Add delete method to Variable class #4963

Merged
merged 1 commit into from
Mar 26, 2019

Conversation

jmsanders
Copy link
Contributor

Make sure you have checked all steps below.

Jira

Description

  • Here are some details about my PR, including screenshots of any UI changes:

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 new Variable.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

  • My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Documentation

  • In case of new functionality, my PR adds documentation that describes how to use it.
    • When adding new operators/hooks/sensors, the autoclass documentation generation needs to be added.
    • All the public functions and the classes in the PR contain docstrings that explain what it does
    • If you implement backwards incompatible changes, please leave a note in the Updating.md so we can assign it to a appropriate release

Code Quality

  • Passes flake8

@jmsanders
Copy link
Contributor Author

@@ -343,7 +343,7 @@ def variables(args):
print(e)
if args.delete:
with db.create_session() as session:
Copy link
Contributor

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-io
Copy link

codecov-io commented Mar 24, 2019

Codecov Report

Merging #4963 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4963      +/-   ##
==========================================
+ Coverage   75.74%   75.74%   +<.01%     
==========================================
  Files         458      458              
  Lines       29850    29853       +3     
==========================================
+ Hits        22609    22612       +3     
  Misses       7241     7241
Impacted Files Coverage Δ
airflow/bin/cli.py 66.97% <100%> (-0.04%) ⬇️
airflow/models/__init__.py 92.94% <100%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 40b7d2b...8ff9150. Read the comment docs.

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

Thanks @jmsanders

@Fokko Fokko merged commit b781932 into apache:master Mar 26, 2019
cthenderson pushed a commit to cthenderson/apache-airflow that referenced this pull request Apr 16, 2019
andriisoldatenko pushed a commit to andriisoldatenko/airflow that referenced this pull request Jul 26, 2019
wmorris75 pushed a commit to modmed/incubator-airflow that referenced this pull request Jul 29, 2019
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.

3 participants