airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (Jira)" <j...@apache.org>
Subject [jira] [Commented] (AIRFLOW-4824) MySqlHook needs to override DbApiHook.get_uri to pull in extra for charset=utf-8 during create_engine
Date Sat, 14 Dec 2019 09:29:00 GMT

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

ASF subversion and git services commented on AIRFLOW-4824:
----------------------------------------------------------

Commit 21e9cadbe4e2681950d60abaf312bf1ffd835b79 in airflow's branch refs/heads/v1-10-test
from zuku1985
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=21e9cad ]

[AIRFLOW-4824] Add charset handling for SqlAlchemy engine for MySqlHook (#6816)

Airflow should handle various charsets for connections with MySQL dbs.
This change allows to set charset in extra field of a connection when
using SqlAlchemy engine.

(cherry picked from commit 27785f47bae1f0336dbae21fa5718b3f309d2e9e)


> MySqlHook needs to override DbApiHook.get_uri to pull in extra for charset=utf-8 during
create_engine
> -----------------------------------------------------------------------------------------------------
>
>                 Key: AIRFLOW-4824
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4824
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: hooks
>    Affects Versions: 1.10.3
>            Reporter: lolcode
>            Assignee: Tomasz Żukowski
>            Priority: Minor
>
> When using the engine from a MySQLHook in other code (such as Pandas) the engine returned
from the create_engine function is missing the charset=utf-8 
> This issue was reported here: [https://stackoverflow.com/questions/46084744/how-to-explicitly-declare-charset-utf8-for-airflow-connections]
> {{{{conn = MySqlHook(mysql_conn_id='conn_id')
> }}}}{{{{engine = conn.get_sqlalchemy_engine()}}}}
> I can see that the code in function *get_uri* in dbapi_hook.py does not use the charset
= utf8 information from the extra section and that mysql_hook.py does not override the function.



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

Mime
View raw message