[AIRFLOW-2227] allow the ability to delete an airflow variable using the variable class #3142
Closed
nadav-baruryan-lmnd wants to merge 4 commits intoapache:masterfrom
Closed
[AIRFLOW-2227] allow the ability to delete an airflow variable using the variable class #3142nadav-baruryan-lmnd wants to merge 4 commits intoapache:masterfrom
nadav-baruryan-lmnd wants to merge 4 commits intoapache:masterfrom
Conversation
7783882 to
9b68a24
Compare
9b68a24 to
2f8fdac
Compare
Codecov Report
@@ Coverage Diff @@
## master #3142 +/- ##
==========================================
- Coverage 76.47% 72.91% -3.56%
==========================================
Files 203 180 -23
Lines 15012 12673 -2339
==========================================
- Hits 11480 9241 -2239
+ Misses 3532 3432 -100
Continue to review full report at Codecov.
|
ashb
requested changes
May 24, 2018
| def delete(cls, key, session=None): | ||
| try: | ||
| session.query(cls).filter(cls.key == key).delete() | ||
| session.commit() |
Member
There was a problem hiding this comment.
This seems suspect - why do we want to commit the session here - shouldn't the caller be in change of the session instead?
| session.commit() | ||
| except Exception as e: | ||
| session.rollback() | ||
| logging.warning("Failed to delete key {}".format(key)) |
|
|
||
| @classmethod | ||
| @provide_session | ||
| def get_keys(cls, session=None): |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make sure you have checked all steps below.
JIRA
Description
In order to allow using migration (via alembic or customized scripts) one need the ability to delete variables (delete function).Another utility function was added to allow retrieval of all the current variables keys.t. This PR allow these abilities.
Tests
Variable methods in models.py has no tests Link
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":
Passes
git diff upstream/master -u -- "*.py" | flake8 --diff