Skip to content

Comments

[AIRFLOW-3864] Recognize lists as JSON in variables --import#4686

Closed
samdfonseca wants to merge 1 commit intoapache:masterfrom
samdfonseca:sam-cli-json-list
Closed

[AIRFLOW-3864] Recognize lists as JSON in variables --import#4686
samdfonseca wants to merge 1 commit intoapache:masterfrom
samdfonseca:sam-cli-json-list

Conversation

@samdfonseca
Copy link

@samdfonseca samdfonseca commented Feb 11, 2019

Make sure you have checked all steps below.

Jira

  • My PR addresses the following Airflow Jira issues and references them in the PR title. For example, "[AIRFLOW-XXX] My Airflow PR"

Description

  • Here are some details about my PR, including screenshots of any UI changes:
    • When settings a variable via import, sets serialize_json=True if its value is a list

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:
    • There doesn't seem to be support currently for cli tests

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

Code Quality

  • Passes flake8

@codecov-io
Copy link

codecov-io commented Feb 11, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4686      +/-   ##
==========================================
+ Coverage   74.35%   74.35%   +<.01%     
==========================================
  Files         430      430              
  Lines       27962    27962              
==========================================
+ Hits        20790    20791       +1     
+ Misses       7172     7171       -1
Impacted Files Coverage Δ
airflow/bin/cli.py 67.22% <100%> (ø) ⬆️
airflow/models/__init__.py 92.79% <0%> (+0.05%) ⬆️

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 59d2615...725f86a. Read the comment docs.

@zhongjiajie
Copy link
Member

LGTM

@samdfonseca
Copy link
Author

@zhongjiajie thanks for the review. Anything you need from me to get this merged?

@OmerJog
Copy link
Contributor

OmerJog commented Feb 13, 2019

Is this related to https://issues.apache.org/jira/browse/AIRFLOW-2141 ?

@zhongjiajie
Copy link
Member

@samdfonseca Sorry, I not a committer, you could at some committer to review and merge your PR, like @Fokko @ashb PTAL thanks.
BTY, welcome to Apache Airflow

@zhongjiajie
Copy link
Member

@OmerJog Yes, I think is related to that jira ticket, do you think we should use

if not isinstance(v, str):
    Variable.set(k, v, serialize_json=True)

@ashb
Copy link
Member

ashb commented Feb 21, 2019

Could you please add some tests to this - there is a case already in tests/core.py - CliTest.test_variables. You'll probably just have to extend the file it imports and add a new assertion or two

Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

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

Please add unit tests

@ashb
Copy link
Member

ashb commented Mar 25, 2019

Please target against AIRFLOW-2141 instead.

@kaxil
Copy link
Member

kaxil commented Jun 21, 2019

Closed in favor of #4991

@kaxil kaxil closed this Jun 21, 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.

6 participants