You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Kaxil Naik (Jira)" <ji...@apache.org> on 2019/12/17 01:43:00 UTC

[jira] [Commented] (AIRFLOW-5469) Airflow CLI render error on unicode in the stdout

    [ https://issues.apache.org/jira/browse/AIRFLOW-5469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16997772#comment-16997772 ] 

Kaxil Naik commented on AIRFLOW-5469:
-------------------------------------

Do you get the same error when using Python3?

> Airflow CLI render error on unicode in the stdout
> -------------------------------------------------
>
>                 Key: AIRFLOW-5469
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5469
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: cli
>    Affects Versions: 1.10.0
>            Reporter: Cong Zhao
>            Assignee: Cong Zhao
>            Priority: Major
>             Fix For: 2.0.0
>
>
> As a non-English user, lots of my hive scripts come along with unicode characters as string values. The hive queries render correctly on Web, but not in CLI. Below is the log of the render output:
> {quote}/usr/local/lib/python2.7/dist-packages/airflow/utils/helpers.py:385: DeprecationWarning: Importing 'HivePartitionSensor' directly from 'airflow.operators' has been deprecated. Please import from 'airflow.operators.[operator_module]' instead. Support for direct imports will be dropped entirely in Airflow 2.0.
> DeprecationWarning)
> /usr/local/lib/python2.7/dist-packages/airflow/utils/helpers.py:385: DeprecationWarning: Importing 'EmailOperator' directly from 'airflow.operators' has been deprecated. Please import from 'airflow.operators.[operator_module]' instead. Support for direct imports will be dropped entirely in Airflow 2.0.
> DeprecationWarning)
> /usr/local/lib/python2.7/dist-packages/airflow/models.py:4007: PendingDeprecationWarning: The requested task could not be added to the DAG because a task with task_id emails_done is already in the DAG. Starting in Airflow 2.0, trying to overwrite a task will raise an exception.
> category=PendingDeprecationWarning)
> Traceback (most recent call last):
> File "/usr/local/bin/airflow", line 32, in <module>
> args.func(args)
> File "/usr/local/lib/python2.7/dist-packages/airflow/utils/cli.py", line 74, in wrapper
> return f(*args, **kwargs)
> File "/usr/local/lib/python2.7/dist-packages/airflow/bin/cli.py", line 601, in render
> """.format(attr, getattr(task, attr))))
> UnicodeEncodeError: 'ascii' codec can't encode characters in position 2138-2139: ordinal not in range(128)
> exitCode 1
> {quote}
>  The issue is simply the string format in the render function doesn't support unicode. [https://github.com/apache/airflow/blob/1.10.0/airflow/bin/cli.py#L603]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)