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
Ensure the log messages from operators during parsing go somewhere #26779
Merged
Conversation
This file contains 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
ashb
requested review from
uranusjr,
jedcunningham and
ephraimbuddy
and removed request for
uranusjr
September 29, 2022 15:14
2 tasks
We shouldn't merge this to a release until we also fix the source of the issue (which is a bug, not user error) |
While investigating apache#26599 and the change from AIP-45, I noticed that these warning messages weren't new! The only thing that was new was that we started seeing them. This is because the logger for BaseOperator and all subclasses is `airflow.task.operators`, and the `airflow.task` logger is not configured (with `set_context()`) until we have a TaskInstance, so it just dropped all messages on the floor! This changes it so that log messages are propagated to parent loggers by default, but when we configure a context (and thus have a file to write to) we stop that. A similar change was made for the `airflow.processor` (but that is unlikely to suffer the same fate)
ashb
force-pushed
the
task_logs_should_go_somewhere
branch
from
September 29, 2022 15:43
e2d19c5
to
fba879e
Compare
jedcunningham
approved these changes
Sep 29, 2022
kaxil
reviewed
Sep 29, 2022
ashb
commented
Sep 29, 2022
The ArangoDB sensor test was logging a mock object, which previously was getting dropped before emitting, but with this change now fails with "Mock is not an integer" when attempting the `%d` intepolation. To avoid making the mock overly specific (`arangodb_client_for_test.db.` `return_value.aql.execute.return_value.count.return_value`!) I have changed the test to mock the hook entirely (which is already tested)
ephraimbuddy
pushed a commit
that referenced
this pull request
Oct 18, 2022
…26779) * Ensure the log messages from operators during parsing go somewhere While investigating #26599 and the change from AIP-45, I noticed that these warning messages weren't new! The only thing that was new was that we started seeing them. This is because the logger for BaseOperator and all subclasses is `airflow.task.operators`, and the `airflow.task` logger is not configured (with `set_context()`) until we have a TaskInstance, so it just dropped all messages on the floor! This changes it so that log messages are propagated to parent loggers by default, but when we configure a context (and thus have a file to write to) we stop that. A similar change was made for the `airflow.processor` (but that is unlikely to suffer the same fate) * Give a real row count value so logs don't fail The ArangoDB sensor test was logging a mock object, which previously was getting dropped before emitting, but with this change now fails with "Mock is not an integer" when attempting the `%d` interpolation. To avoid making the mock overly specific (`arangodb_client_for_test.db.` `return_value.aql.execute.return_value.count.return_value`!) I have changed the test to mock the hook entirely (which is already tested) (cherry picked from commit 7363e35)
37 tasks
2 tasks
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.
While investigating #26599 and the change from AIP-45, I noticed that these warning messages weren't new! The only thing that was new was that we started seeing them.
This is because the logger for BaseOperator and all subclasses is
airflow.task.operators
, and theairflow.task
logger is not configured (withset_context()
) until we have a TaskInstance, so it just dropped all messages on the floor!This changes it so that log messages are propagated to parent loggers by default, but when we configure a context (and thus have a file to write to) we stop that. A similar change was made for the
airflow.processor
(but that is unlikely to suffer the same fate)