File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
providers/mysql/src/airflow/providers/mysql/hooks Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 30
30
logger = logging .getLogger (__name__ )
31
31
32
32
if TYPE_CHECKING :
33
- from airflow .models import Connection
33
+ from airflow .providers .mysql .version_compat import AIRFLOW_V_3_0_PLUS
34
+
35
+ if AIRFLOW_V_3_0_PLUS :
36
+ from airflow .models import Connection
37
+ else :
38
+ from airflow .models .connection import Connection
34
39
35
40
try :
36
41
from mysql .connector .abstracts import MySQLConnectionAbstract
@@ -130,7 +135,7 @@ def _get_conn_config_mysql_client(self, conn: Connection) -> dict:
130
135
131
136
if conn .extra_dejson .get ("charset" , False ):
132
137
conn_config ["charset" ] = conn .extra_dejson ["charset" ]
133
- if conn_config [ "charset" ] .lower () in ("utf8" , "utf-8" ):
138
+ if conn_config . get ( "charset" , "undef" ) .lower () in ("utf8" , "utf-8" ):
134
139
conn_config ["use_unicode" ] = True
135
140
if conn .extra_dejson .get ("cursor" , False ):
136
141
try :
You can’t perform that action at this time.
0 commit comments