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

DockerOperator fix cli.logs giving character array instead of string #24726

Merged
merged 2 commits into from
Jul 5, 2022

Conversation

pasalkarsachin1
Copy link
Contributor

@pasalkarsachin1 pasalkarsachin1 commented Jun 29, 2022

closes: #24681
Based on ticket 24681. cli.logs behaviour is not fixed sometimes it returns the array of character rather than one single string.

This changes was brought as part of change Before that it was returning the data from log_lines. Reverting to some part of it to get correct line

@boring-cyborg
Copy link

boring-cyborg bot commented Jun 29, 2022

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/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, mypy 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

@pasalkarsachin1 pasalkarsachin1 changed the title Fixed issue where cli.logs was giving character array instead of string 24681: Fixed issue where cli.logs was giving character array instead of string Jun 29, 2022
ashb
ashb previously requested changes Jun 29, 2022
airflow/providers/docker/operators/docker.py Outdated Show resolved Hide resolved
airflow/providers/docker/operators/docker.py Outdated Show resolved Hide resolved
Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

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

This change looks okay.

I do wonder if there was some reason that we called got the logs again instead of using tht lines we already had. I expect not, but I wonder who might know.

@ashb ashb dismissed their stale review June 30, 2022 13:24

Changes made

@eladkal eladkal changed the title 24681: Fixed issue where cli.logs was giving character array instead of string DockerOperator fixed issue where cli.logs was giving character array instead of string Jun 30, 2022
@eladkal eladkal changed the title DockerOperator fixed issue where cli.logs was giving character array instead of string DockerOperator fix cli.logs giving character array instead of string Jun 30, 2022
@pasalkarsachin1
Copy link
Contributor Author

This change looks okay.

I do wonder if there was some reason that we called got the logs again instead of using tht lines we already had. I expect not, but I wonder who might know.

As per change I see this is introduce by @ferruzzi

@potiuk
Copy link
Member

potiuk commented Jul 4, 2022

@ferruzzi - any comments ?

@ferruzzi
Copy link
Contributor

ferruzzi commented Jul 4, 2022

I do wonder if there was some reason that we called got the logs again instead of using tht lines we already had. I expect not, but I wonder who might know.

As per change I see this is introduce by @ferruzzi

uranusjr wanted it that way, see discussion here: #21175 (comment)

@pasalkarsachin1
Copy link
Contributor Author

I do wonder if there was some reason that we called got the logs again instead of using tht lines we already had. I expect not, but I wonder who might know.

As per change I see this is introduce by @ferruzzi

uranusjr wanted it that way, see discussion here: #21175 (comment)

I believe the issue solved with stringify API. The issue pointed in above comment is mainly because bytes are returned. Which was cases with logs API as well which solved by #21429

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.

LGTM

@potiuk
Copy link
Member

potiuk commented Jul 5, 2022

@ashb any doubts ?

@ashb
Copy link
Member

ashb commented Jul 5, 2022

Nope.

@potiuk potiuk merged commit cc6a44b into apache:main Jul 5, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Jul 5, 2022

Awesome work, congrats on your first merged pull request!

@pasalkarsachin1 pasalkarsachin1 deleted the issue-24681 branch July 5, 2022 11:45
@ferruzzi
Copy link
Contributor

ferruzzi commented Jul 5, 2022

Cool. Sorry, I should have phrased it as "at the time..." but you got the point. Nice fix. 👍

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.

Docker is not pushing last line over xcom
4 participants