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

[AIRFLOW-6943] Fix utf-8 encodeed description in DAG in Python 2 #7567

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Feb 27, 2020

Jinja expects either unicode strings or ascii-encoded byte strings
and fail if it receives utf8-encoded byte string. In case python
file is UTF8-encoded and description contains UTF-8 characters
displaying the dags uses Jinja template that fails in such case.

This bug workarounds it by attempting to decode the string with
utf-8 decoding and produce unicode instead.


Issue link: AIRFLOW-6943

Make sure to mark the boxes below before creating PR: [x]

  • Description above provides context of the change
  • Commit message/PR title starts with [AIRFLOW-NNNN]. AIRFLOW-NNNN = JIRA ID*
  • Unit tests coverage for changes (not needed for documentation changes)
  • Commits follow "How to write a good git commit message"
  • Relevant documentation is updated including usage instructions.
  • I will engage committers as explained in Contribution Workflow Example.

* For document-only changes commit message can start with [AIRFLOW-XXXX].


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.

Jinja expects either unicode strings or ascii-encoded byte strings
and fail if it receives utf8-encoded byte string. In case python
file is UTF8-encoded and description contains UTF-8 characters
displaying the dags uses Jinja template that fails in such case.

This bug workarounds it by attempting to decode the string with
utf-8 decoding and produce unicode instead.
@boring-cyborg boring-cyborg bot added the area:webserver Webserver related Issues label Feb 27, 2020
@potiuk potiuk requested review from ashb and kaxil February 27, 2020 08:08
@potiuk
Copy link
Member Author

potiuk commented Feb 27, 2020

@ashb @kaxil - this one is 1.10-only, I found it when debugging an encoding-related issue by one of the customers

@potiuk potiuk merged commit 2f818f1 into apache:v1-10-test Feb 27, 2020
kaxil pushed a commit that referenced this pull request Mar 19, 2020
Jinja expects either unicode strings or ascii-encoded byte strings
and fail if it receives utf8-encoded byte string. In case python
file is UTF8-encoded and description contains UTF-8 characters
displaying the dags uses Jinja template that fails in such case.

This bug workarounds it by attempting to decode the string with
utf-8 decoding and produce unicode instead.
kaxil pushed a commit to astronomer/airflow that referenced this pull request Mar 19, 2020
…che#7567)

Jinja expects either unicode strings or ascii-encoded byte strings
and fail if it receives utf8-encoded byte string. In case python
file is UTF8-encoded and description contains UTF-8 characters
displaying the dags uses Jinja template that fails in such case.

This bug workarounds it by attempting to decode the string with
utf-8 decoding and produce unicode instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:webserver Webserver related Issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants