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

Modify return value check in python virtualenv jinja template #16049

Merged

Conversation

enisnazif
Copy link
Contributor

@enisnazif enisnazif commented May 25, 2021

This PR fixes #16022 by changing the check on the return value of a python callable run by the PythonVirtualEnvOperator

@boring-cyborg boring-cyborg bot added the area:core-operators Operators, Sensors and hooks within Core Airflow label May 25, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented May 25, 2021

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, pylint and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@uranusjr
Copy link
Member

Wouldn’t the test still pass even if you don’t fix the issue? I think you need to actually test the return value is False and not None.

@eladkal eladkal changed the title #16022 - Modify return value check in python virtualenv jinja template Modify return value check in python virtualenv jinja template May 25, 2021
@enisnazif
Copy link
Contributor Author

@uranusjr Good point - have added checks on the values returned by task.execute_callable() - this seemed to be the most straightforward way of getting the return value of the python_callable

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

Nice one!

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label May 25, 2021
@github-actions
Copy link

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@enisnazif
Copy link
Contributor Author

Thanks @potiuk - it seems that the Build Images / Build CI images 3.6 (pull_request_target) CI step is failing due to

ERROR: Cannot install apache-airflow[devel-ci]==2.2.0.dev0 because these package versions have conflicting dependencies.

Looks like unrelated to my change - worth rerunning maybe?

@potiuk
Copy link
Member

potiuk commented May 25, 2021

Plese rebase to latest master. The pyarrow limitation is removed there @enisnazif in #16026

@enisnazif enisnazif force-pushed the fix-pythonvirtualenv-return-serialisation branch from e5da9a4 to 6be1dc6 Compare May 25, 2021 17:46
@enisnazif
Copy link
Contributor Author

@uranusjr @potiuk Hi - Is this now ok to be merged, or is anything else required? Thanks

@potiuk
Copy link
Member

potiuk commented May 26, 2021

Just running the tests :)

@potiuk potiuk merged commit 6af963c into apache:master May 26, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented May 26, 2021

Awesome work, congrats on your first merged pull request!

@enisnazif enisnazif deleted the fix-pythonvirtualenv-return-serialisation branch May 26, 2021 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core-operators Operators, Sensors and hooks within Core Airflow full tests needed We need to run full set of tests for this PR to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PythonVirtualEnvOperator not serialising return type of function if False
3 participants