-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
DockerOperator TaskFlow - correct arguments in python command #39620
DockerOperator TaskFlow - correct arguments in python command #39620
Conversation
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 Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congratulations on your first MR. Can you add the test case for your change?
Formatting the traceback with logger prefix message will beautify the logs. However, it is difficult to traceback whether the logs from the same code line or multiple code lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-0.9 Your PR makes the log more beautiful in Airflow webserver, but it also makes it harder to process and analyze via log tools (datadog, cloudwatch, ELK...)
Damn ! I did not expect that. I'm not using such tools... Do you think there is a way to allow both approaches to work ? I thought of indenting the multi-line messages with white spaces matching the length of the logging prefix, but unfortunately the buffering of the messages make such that it is not possible to differentiate one multiline message (such as a Trace back) or multiple messages that are sent at the same time. |
I would be a +0.5 for the log adjustments - nt using ELK but bothered with the output especially in conjunction as also reported in #39686 . My proposal is to make it configurable, maybe as a parameter on the operator? |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
Oh, just realized by stale notifications that by accident #40489 of me also addressed the problem 2 proposed here, but lost track of the other PR being existing. I'm not using the decorator (yet) but can imagine the point 1 in the PR is still valid. |
Hi @jscheffl , thanks for the notice I think I would have missed it ! I'll remove this part from the PR to only address the first point then ! |
Needed when log messages are buffered, and to align the ident of TraceBacks Also add 2 arguments to the python command in order to follow the evolutions of #31747
The test store the log content, and check that the last output is the ValueError of the script, and not the template error.
I've updated the PR by adding a regression test and only addressing the first point, as the second has been addressed. |
Looks good, but fails in a single regression with Airflow 2.7... can you check this? Then I think.. LGTM! |
Thanks ! |
There is quite detailed step-by-step guide how to run provider tests with older versions of airflow locally https://github.com/apache/airflow/blob/main/contributing-docs/testing/unit_tests.rst#running-the-compatibility-tests-locally |
In short |
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
I renamed the commit slighlty - to reflect that it's only #1 from the original PR. |
…#39620) --------- Co-authored-by: Antoine TAVANT <antoine.tavant@ecoco2.com>
Closes #39319
This PR provide two minor changes :
python3 /tmp/script.py /tmp/script.in /tmp/script.out none /tmp/script.out
Indeed, the script used in the DockerOperator in the same as the one in PythonVirtualenvOperator (see airflow/utils/python_virtualenv_script.jinja2 )
Illustration of the multiline splits
Before :
Now
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.