• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

airbnb / airflow / 2764 / 3
0%
master: 0%

Build:
DEFAULT BRANCH: master
Ran 27 May 2016 06:08PM UTC
Files 125
Run time 11s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 May 2016 06:08PM UTC coverage: 66.59% (-0.05%) from 66.642%
TOX_ENV=py27-cdh-airflow_backend_postgres

push

travis-ci

Chris Riccomini
[AIRFLOW-179] DbApiHook string serialization fails when string contains non-ASCII characters

Dear Airflow Maintainers,

Please accept this PR that addresses the following issues:
- https://issues.apache.org/jira/browse/AIRFLOW-179

In addition to correctly serializing non-ASCII characters the literal transformation also corrects an issue with escaping single quotes (').

Note it was my intention to add another unit test to `test_hive_to_mysql` in `tests/core.py` however on inspection the indentations of the various methods seemed wrong, methods are nested and it's not apparent what class they refer to. Additionally it seems a number of the test cases aren't related to the corresponding class.

For testing purposes I simply ran a pipeline which previously failed with the following exception,

    [2016-05-26 22:03:39,256] {models.py:1286} ERROR - 'ascii' codec can't decode byte 0xc3 in position 230: ordinal not in range(128)
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/airflow/models.py", line 1245, in run
    result = task_copy.execute(context=context)
      File "/usr/local/lib/python2.7/dist-packages/airflow/operators/hive_to_mysql.py", line 88, in execute
    mysql.insert_rows(table=self.mysql_table, rows=results)
      File "/usr/local/lib/python2.7/dist-packages/airflow/hooks/dbapi_hook.py", line 176, in insert_rows
    l.append(self._serialize_cell(cell))
      File "/usr/local/lib/python2.7/dist-packages/airflow/hooks/dbapi_hook.py", line 196, in _serialize_cell
    return "'" + str(cell).replace("'", "''") + "'"
      File "/usr/local/lib/python2.7/dist-packages/future/types/newstr.py", line 102, in __new__
    return super(newstr, cls).__new__(cls, value)
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 230: ordinal not in range(128)

and verified with the presence of the fix that the task succeeded and the resulting output was correct. Note currently from grokking the code base it seems that only `MySqlHook` objects call the the `insert_rows` method.

Author: John Bodley <john.bodley@airbnb.com>

Closes #1550 from johnbodley/dbapi_hook_serialization.

5477 of 8225 relevant lines covered (66.59%)

0.67 hits per line

Source Files on job 2764.3 (TOX_ENV=py27-cdh-airflow_backend_postgres)
  • Tree
  • List 0
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 2764
  • Travis Job 2764.3
  • 87b4b8fa on github
  • Prev Job for TOX_ENV=py27-cdh-airflow_backend_postgres on master (#2763.3)
  • Next Job for TOX_ENV=py27-cdh-airflow_backend_postgres on master (#2766.3)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc