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-4679] Make airflow/operators Pylint compatible #7757

Conversation

feluelle
Copy link
Member

@feluelle feluelle commented Mar 18, 2020

  • remove unused lineage_data field in BashOperator
  • fix string formatting in AirflowException in PythonVirtualenvOperator

Issue link: AIRFLOW-4679

Make sure to mark the boxes below before creating PR: [x]

  • Description above provides context of the change
  • Commit message/PR title starts with [AIRFLOW-NNNN]. AIRFLOW-NNNN = JIRA ID*
  • Unit tests coverage for changes (not needed for documentation changes)
  • Commits follow "How to write a good git commit message"
  • Relevant documentation is updated including usage instructions.
  • I will engage committers as explained in Contribution Workflow Example.

* For document-only changes commit message can start with [AIRFLOW-XXXX].


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.
Read the Pull Request Guidelines for more information.

- remove unused lineage_data field in BashOperator
- fix string formatting in AirflowException in PythonVirtualenvOperator
raise AirflowException('{} only supports functions for python_callable arg',
self.__class__.__name__)
raise AirflowException('{} only supports functions for python_callable arg'.format(
self.__class__.__name__))
Copy link
Member

Choose a reason for hiding this comment

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

Should we use f-string?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure.

@@ -100,8 +100,6 @@ def execute(self, context):
for k, v in airflow_context_vars.items()]))
env.update(airflow_context_vars)

self.lineage_data = self.bash_command
Copy link
Member

Choose a reason for hiding this comment

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

Isn't it something related to lineage? 👀

Copy link
Member Author

Choose a reason for hiding this comment

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

@ashb @mik-laj do you know if this is required?

Copy link
Member

Choose a reason for hiding this comment

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

No, it is no longer required. The lineage backend has been modified and this was used earlier

@codecov-io
Copy link

codecov-io commented Mar 18, 2020

Codecov Report

Merging #7757 into master will decrease coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7757      +/-   ##
==========================================
- Coverage   86.98%   86.91%   -0.08%     
==========================================
  Files         915      915              
  Lines       44231    44224       -7     
==========================================
- Hits        38476    38436      -40     
- Misses       5755     5788      +33     
Impacted Files Coverage Δ
airflow/operators/bash.py 90.38% <100.00%> (-0.19%) ⬇️
airflow/operators/check_operator.py 92.48% <100.00%> (-0.12%) ⬇️
airflow/operators/python.py 94.96% <100.00%> (-0.04%) ⬇️
airflow/providers/postgres/operators/postgres.py 50.00% <0.00%> (-50.00%) ⬇️
...roviders/google/cloud/operators/postgres_to_gcs.py 54.28% <0.00%> (-31.43%) ⬇️
airflow/providers/postgres/hooks/postgres.py 78.87% <0.00%> (-15.50%) ⬇️
...providers/google/cloud/example_dags/example_gcs.py 96.29% <0.00%> (ø)
...viders/google/cloud/example_dags/example_speech.py 100.00% <0.00%> (ø)
...viders/google/cloud/example_dags/example_vision.py 100.00% <0.00%> (ø)
...iders/google/cloud/example_dags/example_compute.py 100.00% <0.00%> (ø)
... and 10 more

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 4e626be...a6c55ec. Read the comment docs.

@kaxil kaxil merged commit 2869d3d into apache:master Mar 19, 2020
@feluelle feluelle deleted the feature/AIRFLOW-4679-airflow-operators-pylint-compatible branch April 30, 2020 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants