-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Extract TaskLogReader from views.py #9391
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
Conversation
airflow/www/views.py
Outdated
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.
Does Javascript need to be updated?
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.
Everything is fine with the logging on the website
|
@KevinYang21 Could you look at it? We need to extract logic to be able to reuse it in the API.@KevinYang21 |
airflow/utils/log/log_reader.py
Outdated
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.
Can you add return type?
airflow/utils/log/log_reader.py
Outdated
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.
Can you add return type?
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.
Fixed f829810
airflow/utils/log/log_reader.py
Outdated
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.
Could you describe here how to use this function? I would be happy to add a code snippet to explain how to use metadata.
while 'end_of_log' not in metadata or not metadata['end_of_log']:
logs, metadata = self.read_log_chunks(ti, current_try_number, metadata)
for log in logs:
print(log)
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.
Check this 8c383bf
|
Please add a description to the PR |
|
Hi @kaxil, please take a look, I have updated the description. Thanks for pointing this out. |
|
@ephraimbuddy Can you do a rebase? |
Co-authored-by: Kamil Breguła <[email protected]>
This reverts commit cbe163995f86fd69e298519b25fa07c7b857fce4.
This reverts commit edbf5c085f8d0d9de05a2775ae3683f1186eeb19.

Currently the logic for reading task logs is implemented inside
views.py.This logic is also needed in API and it would be better if the logic is extracted from the view and tested separately. This will enable reuse of the logic in API
log_endpoint.Make sure to mark the boxes below before creating PR: [x]
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.