[
https://issues.apache.org/jira/browse/AIRFLOW-896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15883038#comment-15883038
]
ASF subversion and git services commented on AIRFLOW-896:
---------------------------------------------------------
Commit 2bceeed80bf2f596d05d2dab47539f20f934c74c in incubator-airflow's branch
refs/heads/master from [~mremes]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=2bceeed ]
[AIRFLOW-896] Remove unicode to 8-bit conversion in BigQueryOperator
For some reason, we have a str() call on a string when logging
an error. This causes a unicode error if the BigQuery query string
has non-ascii characters in it. The fix seems to be to just remove
the str() call.
Closes #2097 from mremes/master
> BigQueryOperator fails to execute with certain input
> ----------------------------------------------------
>
> Key: AIRFLOW-896
> URL: https://issues.apache.org/jira/browse/AIRFLOW-896
> Project: Apache Airflow
> Issue Type: Bug
> Components: contrib
> Environment: Darwin Kernel Version 16.3.0 (OSX)
> Python 2.7.12 | Anaconda 4.2.0 (x86_64)
> Reporter: Matti Remes
> Assignee: Matti Remes
> Fix For: Airflow 1.8
>
>
> When the query is formatted to the log message argument, it fails with inputs
> containing unicode characters (depending on Python encoding of the
> environment).
> Log:
> [2017-02-23 21:58:57,582] {base_task_runner.py:95} INFO - Subtask: Traceback
> (most recent call last):
> [2017-02-23 21:58:57,583] {base_task_runner.py:95} INFO - Subtask: File
> "/Users/Matti/anaconda2/lib/python2.7/site-packages/airflow-1.9.0.dev0+apache.incubating-py2.7.egg/airflow/models.py",
> line 1371, in run
> [2017-02-23 21:58:57,583] {base_task_runner.py:95} INFO - Subtask: result
> = task_copy.execute(context=context)
> [2017-02-23 21:58:57,583] {base_task_runner.py:95} INFO - Subtask: File
> "/Users/Matti/anaconda2/lib/python2.7/site-packages/airflow-1.9.0.dev0+apache.incubating-py2.7.egg/airflow/contrib/operators/bigquery_operator.py",
> line 76, in execute
> [2017-02-23 21:58:57,583] {base_task_runner.py:95} INFO - Subtask:
> logging.info('Executing: %s', str(self.bql))
> [2017-02-23 21:58:57,583] {base_task_runner.py:95} INFO - Subtask:
> UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in
> position 2155: ordinal not in range(128)
> Pull request coming.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)