apache-airflow-providers-mysql 5.5.2__py3-none-any.whl → 6.4.1rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of apache-airflow-providers-mysql might be problematic. Click here for more details.
- airflow/providers/mysql/__init__.py +5 -8
- airflow/providers/mysql/{operators → assets}/__init__.py +0 -1
- airflow/providers/mysql/assets/mysql.py +34 -0
- airflow/providers/mysql/get_provider_info.py +8 -48
- airflow/providers/mysql/hooks/mysql.py +109 -28
- airflow/providers/mysql/transfers/presto_to_mysql.py +4 -3
- airflow/providers/mysql/transfers/s3_to_mysql.py +6 -5
- airflow/providers/mysql/transfers/trino_to_mysql.py +4 -3
- airflow/providers/mysql/transfers/vertica_to_mysql.py +29 -21
- airflow/providers/mysql/version_compat.py +34 -0
- {apache_airflow_providers_mysql-5.5.2.dist-info → apache_airflow_providers_mysql-6.4.1rc1.dist-info}/METADATA +62 -61
- apache_airflow_providers_mysql-6.4.1rc1.dist-info/RECORD +18 -0
- {apache_airflow_providers_mysql-5.5.2.dist-info → apache_airflow_providers_mysql-6.4.1rc1.dist-info}/WHEEL +1 -1
- {airflow/providers/mysql → apache_airflow_providers_mysql-6.4.1rc1.dist-info/licenses}/LICENSE +0 -52
- apache_airflow_providers_mysql-6.4.1rc1.dist-info/licenses/NOTICE +5 -0
- airflow/providers/mysql/operators/mysql.py +0 -74
- apache_airflow_providers_mysql-5.5.2.dist-info/RECORD +0 -16
- {apache_airflow_providers_mysql-5.5.2.dist-info → apache_airflow_providers_mysql-6.4.1rc1.dist-info}/entry_points.txt +0 -0
|
@@ -25,18 +25,15 @@ from __future__ import annotations
|
|
|
25
25
|
|
|
26
26
|
import packaging.version
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
from airflow import __version__ as airflow_version
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
__all__ = ["__version__"]
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
from airflow import __version__ as airflow_version
|
|
34
|
-
except ImportError:
|
|
35
|
-
from airflow.version import version as airflow_version
|
|
32
|
+
__version__ = "6.4.1"
|
|
36
33
|
|
|
37
34
|
if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
|
|
38
|
-
"2.
|
|
35
|
+
"2.11.0"
|
|
39
36
|
):
|
|
40
37
|
raise RuntimeError(
|
|
41
|
-
f"The package `apache-airflow-providers-mysql:{__version__}` needs Apache Airflow 2.
|
|
38
|
+
f"The package `apache-airflow-providers-mysql:{__version__}` needs Apache Airflow 2.11.0+"
|
|
42
39
|
)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
|
3
|
+
# distributed with this work for additional information
|
|
4
|
+
# regarding copyright ownership. The ASF licenses this file
|
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
|
6
|
+
# "License"); you may not use this file except in compliance
|
|
7
|
+
# with the License. You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
|
12
|
+
# software distributed under the License is distributed on an
|
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
# KIND, either express or implied. See the License for the
|
|
15
|
+
# specific language governing permissions and limitations
|
|
16
|
+
# under the License.
|
|
17
|
+
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
from typing import TYPE_CHECKING
|
|
21
|
+
|
|
22
|
+
if TYPE_CHECKING:
|
|
23
|
+
from urllib.parse import SplitResult
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def sanitize_uri(uri: SplitResult) -> SplitResult:
|
|
27
|
+
if not uri.netloc:
|
|
28
|
+
raise ValueError("URI format mysql:// must contain a host")
|
|
29
|
+
if uri.port is None:
|
|
30
|
+
host = uri.netloc.rstrip(":")
|
|
31
|
+
uri = uri._replace(netloc=f"{host}:3306")
|
|
32
|
+
if len(uri.path.split("/")) != 3: # Leading slash, database name, and table name.
|
|
33
|
+
raise ValueError("URI format mysql:// must contain database and table names")
|
|
34
|
+
return uri._replace(scheme="mysql")
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
17
|
|
|
18
|
-
# NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE
|
|
19
|
-
# OVERWRITTEN WHEN PREPARING PACKAGES.
|
|
18
|
+
# NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN!
|
|
20
19
|
#
|
|
21
20
|
# IF YOU WANT TO MODIFY THIS FILE, YOU SHOULD MODIFY THE TEMPLATE
|
|
22
21
|
# `get_provider_info_TEMPLATE.py.jinja2` IN the `dev/breeze/src/airflow_breeze/templates` DIRECTORY
|
|
@@ -27,60 +26,15 @@ def get_provider_info():
|
|
|
27
26
|
"package-name": "apache-airflow-providers-mysql",
|
|
28
27
|
"name": "MySQL",
|
|
29
28
|
"description": "`MySQL <https://www.mysql.com/>`__\n",
|
|
30
|
-
"state": "ready",
|
|
31
|
-
"source-date-epoch": 1705912175,
|
|
32
|
-
"versions": [
|
|
33
|
-
"5.5.2",
|
|
34
|
-
"5.5.1",
|
|
35
|
-
"5.5.0",
|
|
36
|
-
"5.4.0",
|
|
37
|
-
"5.3.1",
|
|
38
|
-
"5.3.0",
|
|
39
|
-
"5.2.1",
|
|
40
|
-
"5.2.0",
|
|
41
|
-
"5.1.1",
|
|
42
|
-
"5.1.0",
|
|
43
|
-
"5.0.0",
|
|
44
|
-
"4.0.2",
|
|
45
|
-
"4.0.1",
|
|
46
|
-
"4.0.0",
|
|
47
|
-
"3.4.0",
|
|
48
|
-
"3.3.0",
|
|
49
|
-
"3.2.1",
|
|
50
|
-
"3.2.0",
|
|
51
|
-
"3.1.0",
|
|
52
|
-
"3.0.0",
|
|
53
|
-
"2.2.3",
|
|
54
|
-
"2.2.2",
|
|
55
|
-
"2.2.1",
|
|
56
|
-
"2.2.0",
|
|
57
|
-
"2.1.1",
|
|
58
|
-
"2.1.0",
|
|
59
|
-
"2.0.0",
|
|
60
|
-
"1.1.0",
|
|
61
|
-
"1.0.2",
|
|
62
|
-
"1.0.1",
|
|
63
|
-
"1.0.0",
|
|
64
|
-
],
|
|
65
|
-
"dependencies": [
|
|
66
|
-
"apache-airflow>=2.6.0",
|
|
67
|
-
"apache-airflow-providers-common-sql>=1.3.1",
|
|
68
|
-
"mysqlclient>=1.3.6",
|
|
69
|
-
"mysql-connector-python>=8.0.29",
|
|
70
|
-
],
|
|
71
|
-
"additional-extras": [{"name": "mysql-connector-python", "dependencies": []}],
|
|
72
29
|
"integrations": [
|
|
73
30
|
{
|
|
74
31
|
"integration-name": "MySQL",
|
|
75
32
|
"external-doc-url": "https://www.mysql.com/",
|
|
76
33
|
"how-to-guide": ["/docs/apache-airflow-providers-mysql/operators.rst"],
|
|
77
|
-
"logo": "/integration-logos/
|
|
34
|
+
"logo": "/docs/integration-logos/MySQL.png",
|
|
78
35
|
"tags": ["software"],
|
|
79
36
|
}
|
|
80
37
|
],
|
|
81
|
-
"operators": [
|
|
82
|
-
{"integration-name": "MySQL", "python-modules": ["airflow.providers.mysql.operators.mysql"]}
|
|
83
|
-
],
|
|
84
38
|
"hooks": [{"integration-name": "MySQL", "python-modules": ["airflow.providers.mysql.hooks.mysql"]}],
|
|
85
39
|
"transfers": [
|
|
86
40
|
{
|
|
@@ -107,4 +61,10 @@ def get_provider_info():
|
|
|
107
61
|
"connection-types": [
|
|
108
62
|
{"hook-class-name": "airflow.providers.mysql.hooks.mysql.MySqlHook", "connection-type": "mysql"}
|
|
109
63
|
],
|
|
64
|
+
"asset-uris": [
|
|
65
|
+
{"schemes": ["mysql", "mariadb"], "handler": "airflow.providers.mysql.assets.mysql.sanitize_uri"}
|
|
66
|
+
],
|
|
67
|
+
"dataset-uris": [
|
|
68
|
+
{"schemes": ["mysql", "mariadb"], "handler": "airflow.providers.mysql.assets.mysql.sanitize_uri"}
|
|
69
|
+
],
|
|
110
70
|
}
|
|
@@ -16,25 +16,35 @@
|
|
|
16
16
|
# specific language governing permissions and limitations
|
|
17
17
|
# under the License.
|
|
18
18
|
"""This module allows to connect to a MySQL database."""
|
|
19
|
+
|
|
19
20
|
from __future__ import annotations
|
|
20
21
|
|
|
21
22
|
import json
|
|
22
23
|
import logging
|
|
23
24
|
from typing import TYPE_CHECKING, Any, Union
|
|
25
|
+
from urllib.parse import quote_plus, urlencode
|
|
24
26
|
|
|
25
|
-
from airflow.
|
|
27
|
+
from airflow.providers.common.compat.sdk import AirflowOptionalProviderFeatureException
|
|
26
28
|
from airflow.providers.common.sql.hooks.sql import DbApiHook
|
|
27
29
|
|
|
28
30
|
logger = logging.getLogger(__name__)
|
|
29
31
|
|
|
30
32
|
if TYPE_CHECKING:
|
|
31
|
-
from airflow.
|
|
33
|
+
from airflow.providers.common.compat.sdk import Connection
|
|
32
34
|
|
|
33
35
|
try:
|
|
34
36
|
from mysql.connector.abstracts import MySQLConnectionAbstract
|
|
35
37
|
except ModuleNotFoundError:
|
|
36
38
|
logger.warning("The package 'mysql-connector-python' is not installed. Import skipped")
|
|
37
|
-
|
|
39
|
+
try:
|
|
40
|
+
from MySQLdb.connections import Connection as MySQLdbConnection
|
|
41
|
+
except ImportError:
|
|
42
|
+
raise RuntimeError(
|
|
43
|
+
"You do not have `mysqlclient` package installed. "
|
|
44
|
+
"Please install it with `pip install mysqlclient` and make sure you have system "
|
|
45
|
+
"mysql libraries installed, as well as well as `pkg-config` system package "
|
|
46
|
+
"installed in case you see compilation error during installation."
|
|
47
|
+
)
|
|
38
48
|
|
|
39
49
|
MySQLConnectionTypes = Union["MySQLdbConnection", "MySQLConnectionAbstract"]
|
|
40
50
|
|
|
@@ -69,9 +79,8 @@ class MySqlHook(DbApiHook):
|
|
|
69
79
|
supports_autocommit = True
|
|
70
80
|
|
|
71
81
|
def __init__(self, *args, **kwargs) -> None:
|
|
72
|
-
super().__init__(*args, **kwargs)
|
|
82
|
+
super().__init__(*args, **{**kwargs, **{"escape_word_format": "`{}`"}})
|
|
73
83
|
self.schema = kwargs.pop("schema", None)
|
|
74
|
-
self.connection = kwargs.pop("connection", None)
|
|
75
84
|
self.local_infile = kwargs.pop("local_infile", False)
|
|
76
85
|
self.init_command = kwargs.pop("init_command", None)
|
|
77
86
|
|
|
@@ -102,8 +111,7 @@ class MySqlHook(DbApiHook):
|
|
|
102
111
|
"""
|
|
103
112
|
if hasattr(conn.__class__, "autocommit") and isinstance(conn.__class__.autocommit, property):
|
|
104
113
|
return conn.autocommit
|
|
105
|
-
|
|
106
|
-
return conn.get_autocommit() # type: ignore[union-attr]
|
|
114
|
+
return conn.get_autocommit() # type: ignore[union-attr]
|
|
107
115
|
|
|
108
116
|
def _get_conn_config_mysql_client(self, conn: Connection) -> dict:
|
|
109
117
|
conn_config = {
|
|
@@ -122,17 +130,30 @@ class MySqlHook(DbApiHook):
|
|
|
122
130
|
|
|
123
131
|
if conn.extra_dejson.get("charset", False):
|
|
124
132
|
conn_config["charset"] = conn.extra_dejson["charset"]
|
|
125
|
-
if conn_config
|
|
133
|
+
if str(conn_config.get("charset", "undef")).lower() in ("utf8", "utf-8"):
|
|
126
134
|
conn_config["use_unicode"] = True
|
|
127
135
|
if conn.extra_dejson.get("cursor", False):
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
+
try:
|
|
137
|
+
import MySQLdb.cursors
|
|
138
|
+
except ImportError:
|
|
139
|
+
raise RuntimeError(
|
|
140
|
+
"You do not have `mysqlclient` package installed. "
|
|
141
|
+
"Please install it with `pip install mysqlclient` and make sure you have system "
|
|
142
|
+
"mysql libraries installed, as well as well as `pkg-config` system package "
|
|
143
|
+
"installed in case you see compilation error during installation."
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
cursor_type = conn.extra_dejson.get("cursor", "").lower()
|
|
147
|
+
# Dictionary mapping cursor types to their respective classes
|
|
148
|
+
cursor_classes = {
|
|
149
|
+
"sscursor": MySQLdb.cursors.SSCursor,
|
|
150
|
+
"dictcursor": MySQLdb.cursors.DictCursor,
|
|
151
|
+
"ssdictcursor": MySQLdb.cursors.SSDictCursor,
|
|
152
|
+
}
|
|
153
|
+
# Set the cursor class in the connection configuration based on the cursor type
|
|
154
|
+
if cursor_type in cursor_classes:
|
|
155
|
+
conn_config["cursorclass"] = cursor_classes[cursor_type]
|
|
156
|
+
|
|
136
157
|
if conn.extra_dejson.get("ssl", False):
|
|
137
158
|
# SSL parameter for MySQL has to be a dictionary and in case
|
|
138
159
|
# of extra/dejson we can get string if extra is passed via
|
|
@@ -173,7 +194,7 @@ class MySqlHook(DbApiHook):
|
|
|
173
194
|
|
|
174
195
|
def get_conn(self) -> MySQLConnectionTypes:
|
|
175
196
|
"""
|
|
176
|
-
|
|
197
|
+
Get connection to a MySQL database.
|
|
177
198
|
|
|
178
199
|
Establishes a connection to a mysql database
|
|
179
200
|
by extracting the connection configuration from the Airflow connection.
|
|
@@ -184,12 +205,20 @@ class MySqlHook(DbApiHook):
|
|
|
184
205
|
|
|
185
206
|
:return: a mysql connection object
|
|
186
207
|
"""
|
|
187
|
-
conn = self.connection or self.get_connection(
|
|
208
|
+
conn = self.connection or self.get_connection(self.get_conn_id())
|
|
188
209
|
|
|
189
210
|
client_name = conn.extra_dejson.get("client", "mysqlclient")
|
|
190
211
|
|
|
191
212
|
if client_name == "mysqlclient":
|
|
192
|
-
|
|
213
|
+
try:
|
|
214
|
+
import MySQLdb
|
|
215
|
+
except ImportError:
|
|
216
|
+
raise RuntimeError(
|
|
217
|
+
"You do not have `mysqlclient` package installed. "
|
|
218
|
+
"Please install it with `pip install mysqlclient` and make sure you have system "
|
|
219
|
+
"mysql libraries installed, as well as well as `pkg-config` system package "
|
|
220
|
+
"installed in case you see compilation error during installation."
|
|
221
|
+
)
|
|
193
222
|
|
|
194
223
|
conn_config = self._get_conn_config_mysql_client(conn)
|
|
195
224
|
return MySQLdb.connect(**conn_config)
|
|
@@ -211,25 +240,37 @@ class MySqlHook(DbApiHook):
|
|
|
211
240
|
|
|
212
241
|
def bulk_load(self, table: str, tmp_file: str) -> None:
|
|
213
242
|
"""Load a tab-delimited file into a database table."""
|
|
243
|
+
import re
|
|
244
|
+
|
|
214
245
|
conn = self.get_conn()
|
|
215
246
|
cur = conn.cursor()
|
|
247
|
+
|
|
248
|
+
if not re.fullmatch(r"^[a-zA-Z0-9_.]+$", table):
|
|
249
|
+
raise ValueError(f"Invalid table name: {table}")
|
|
250
|
+
|
|
216
251
|
cur.execute(
|
|
217
|
-
f"LOAD DATA LOCAL INFILE %s INTO TABLE {table}",
|
|
252
|
+
f"LOAD DATA LOCAL INFILE %s INTO TABLE `{table}`",
|
|
218
253
|
(tmp_file,),
|
|
219
254
|
)
|
|
220
255
|
conn.commit()
|
|
221
|
-
conn.close()
|
|
256
|
+
conn.close()
|
|
222
257
|
|
|
223
258
|
def bulk_dump(self, table: str, tmp_file: str) -> None:
|
|
224
259
|
"""Dump a database table into a tab-delimited file."""
|
|
260
|
+
import re
|
|
261
|
+
|
|
225
262
|
conn = self.get_conn()
|
|
226
263
|
cur = conn.cursor()
|
|
264
|
+
|
|
265
|
+
if not re.fullmatch(r"^[a-zA-Z0-9_.]+$", table):
|
|
266
|
+
raise ValueError(f"Invalid table name: {table}")
|
|
267
|
+
|
|
227
268
|
cur.execute(
|
|
228
|
-
f"SELECT * INTO OUTFILE %s FROM {table}",
|
|
269
|
+
f"SELECT * INTO OUTFILE %s FROM `{table}`",
|
|
229
270
|
(tmp_file,),
|
|
230
271
|
)
|
|
231
272
|
conn.commit()
|
|
232
|
-
conn.close()
|
|
273
|
+
conn.close()
|
|
233
274
|
|
|
234
275
|
@staticmethod
|
|
235
276
|
def _serialize_cell(cell: object, conn: Connection | None = None) -> Any:
|
|
@@ -268,7 +309,7 @@ class MySqlHook(DbApiHook):
|
|
|
268
309
|
self, table: str, tmp_file: str, duplicate_key_handling: str = "IGNORE", extra_options: str = ""
|
|
269
310
|
) -> None:
|
|
270
311
|
"""
|
|
271
|
-
|
|
312
|
+
Load local data from a file into the database in a more configurable way.
|
|
272
313
|
|
|
273
314
|
.. warning:: According to the mysql docs using this function is a
|
|
274
315
|
`security risk <https://dev.mysql.com/doc/refman/8.0/en/load-data-local.html>`_.
|
|
@@ -290,16 +331,16 @@ class MySqlHook(DbApiHook):
|
|
|
290
331
|
cursor = conn.cursor()
|
|
291
332
|
|
|
292
333
|
cursor.execute(
|
|
293
|
-
f"LOAD DATA LOCAL INFILE %s %s INTO TABLE {table} %s",
|
|
334
|
+
f"LOAD DATA LOCAL INFILE %s %s INTO TABLE `{table}` %s",
|
|
294
335
|
(tmp_file, duplicate_key_handling, extra_options),
|
|
295
336
|
)
|
|
296
337
|
|
|
297
338
|
cursor.close()
|
|
298
339
|
conn.commit()
|
|
299
|
-
conn.close()
|
|
340
|
+
conn.close()
|
|
300
341
|
|
|
301
342
|
def get_openlineage_database_info(self, connection):
|
|
302
|
-
"""
|
|
343
|
+
"""Return MySQL specific information for OpenLineage."""
|
|
303
344
|
from airflow.providers.openlineage.sqlparser import DatabaseInfo
|
|
304
345
|
|
|
305
346
|
return DatabaseInfo(
|
|
@@ -316,9 +357,49 @@ class MySqlHook(DbApiHook):
|
|
|
316
357
|
)
|
|
317
358
|
|
|
318
359
|
def get_openlineage_database_dialect(self, _):
|
|
319
|
-
"""
|
|
360
|
+
"""Return database dialect."""
|
|
320
361
|
return "mysql"
|
|
321
362
|
|
|
322
363
|
def get_openlineage_default_schema(self):
|
|
323
364
|
"""MySQL has no concept of schema."""
|
|
324
365
|
return None
|
|
366
|
+
|
|
367
|
+
def get_uri(self) -> str:
|
|
368
|
+
"""Get URI for MySQL connection."""
|
|
369
|
+
conn = self.connection or self.get_connection(self.get_conn_id())
|
|
370
|
+
conn_schema = self.schema or conn.schema or ""
|
|
371
|
+
client_name = conn.extra_dejson.get("client", "mysqlclient")
|
|
372
|
+
|
|
373
|
+
# Determine URI prefix based on client
|
|
374
|
+
if client_name == "mysql-connector-python":
|
|
375
|
+
uri_prefix = "mysql+mysqlconnector://"
|
|
376
|
+
elif client_name == "pymysql":
|
|
377
|
+
uri_prefix = "mysql+pymysql://"
|
|
378
|
+
else: # default: mysqlclient
|
|
379
|
+
uri_prefix = "mysql://"
|
|
380
|
+
|
|
381
|
+
auth_part = ""
|
|
382
|
+
if conn.login:
|
|
383
|
+
auth_part = quote_plus(conn.login)
|
|
384
|
+
if conn.password:
|
|
385
|
+
auth_part = f"{auth_part}:{quote_plus(conn.password)}"
|
|
386
|
+
auth_part = f"{auth_part}@"
|
|
387
|
+
|
|
388
|
+
host_part = conn.host or "localhost"
|
|
389
|
+
if conn.port:
|
|
390
|
+
host_part = f"{host_part}:{conn.port}"
|
|
391
|
+
|
|
392
|
+
schema_part = f"/{quote_plus(conn_schema)}" if conn_schema else ""
|
|
393
|
+
|
|
394
|
+
uri = f"{uri_prefix}{auth_part}{host_part}{schema_part}"
|
|
395
|
+
|
|
396
|
+
# Add extra connection parameters
|
|
397
|
+
extra = conn.extra_dejson.copy()
|
|
398
|
+
if "client" in extra:
|
|
399
|
+
extra.pop("client")
|
|
400
|
+
|
|
401
|
+
query_params = {k: str(v) for k, v in extra.items() if v}
|
|
402
|
+
if query_params:
|
|
403
|
+
uri = f"{uri}?{urlencode(query_params)}"
|
|
404
|
+
|
|
405
|
+
return uri
|
|
@@ -17,14 +17,15 @@
|
|
|
17
17
|
# under the License.
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
|
-
from
|
|
20
|
+
from collections.abc import Sequence
|
|
21
|
+
from typing import TYPE_CHECKING
|
|
21
22
|
|
|
22
|
-
from airflow.
|
|
23
|
+
from airflow.providers.common.compat.sdk import BaseOperator
|
|
23
24
|
from airflow.providers.mysql.hooks.mysql import MySqlHook
|
|
24
25
|
from airflow.providers.presto.hooks.presto import PrestoHook
|
|
25
26
|
|
|
26
27
|
if TYPE_CHECKING:
|
|
27
|
-
from airflow.
|
|
28
|
+
from airflow.providers.common.compat.sdk import Context
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
class PrestoToMySqlOperator(BaseOperator):
|
|
@@ -17,14 +17,15 @@
|
|
|
17
17
|
from __future__ import annotations
|
|
18
18
|
|
|
19
19
|
import os
|
|
20
|
-
from
|
|
20
|
+
from collections.abc import Sequence
|
|
21
|
+
from typing import TYPE_CHECKING
|
|
21
22
|
|
|
22
|
-
from airflow.models import BaseOperator
|
|
23
23
|
from airflow.providers.amazon.aws.hooks.s3 import S3Hook
|
|
24
|
+
from airflow.providers.common.compat.sdk import BaseOperator
|
|
24
25
|
from airflow.providers.mysql.hooks.mysql import MySqlHook
|
|
25
26
|
|
|
26
27
|
if TYPE_CHECKING:
|
|
27
|
-
from airflow.
|
|
28
|
+
from airflow.providers.common.compat.sdk import Context
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
class S3ToMySqlOperator(BaseOperator):
|
|
@@ -59,7 +60,7 @@ class S3ToMySqlOperator(BaseOperator):
|
|
|
59
60
|
mysql_table: str,
|
|
60
61
|
mysql_duplicate_key_handling: str = "IGNORE",
|
|
61
62
|
mysql_extra_options: str | None = None,
|
|
62
|
-
aws_conn_id: str = "aws_default",
|
|
63
|
+
aws_conn_id: str | None = "aws_default",
|
|
63
64
|
mysql_conn_id: str = "mysql_default",
|
|
64
65
|
mysql_local_infile: bool = False,
|
|
65
66
|
**kwargs,
|
|
@@ -75,7 +76,7 @@ class S3ToMySqlOperator(BaseOperator):
|
|
|
75
76
|
|
|
76
77
|
def execute(self, context: Context) -> None:
|
|
77
78
|
"""
|
|
78
|
-
|
|
79
|
+
Execute the transfer operation from S3 to MySQL.
|
|
79
80
|
|
|
80
81
|
:param context: The context that is being provided when executing.
|
|
81
82
|
"""
|
|
@@ -17,14 +17,15 @@
|
|
|
17
17
|
# under the License.
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
|
-
from
|
|
20
|
+
from collections.abc import Sequence
|
|
21
|
+
from typing import TYPE_CHECKING
|
|
21
22
|
|
|
22
|
-
from airflow.
|
|
23
|
+
from airflow.providers.common.compat.sdk import BaseOperator
|
|
23
24
|
from airflow.providers.mysql.hooks.mysql import MySqlHook
|
|
24
25
|
from airflow.providers.trino.hooks.trino import TrinoHook
|
|
25
26
|
|
|
26
27
|
if TYPE_CHECKING:
|
|
27
|
-
from airflow.
|
|
28
|
+
from airflow.providers.common.compat.sdk import Context
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
class TrinoToMySqlOperator(BaseOperator):
|
|
@@ -18,18 +18,27 @@
|
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
20
20
|
import csv
|
|
21
|
+
from collections.abc import Sequence
|
|
21
22
|
from contextlib import closing
|
|
22
23
|
from tempfile import NamedTemporaryFile
|
|
23
|
-
from typing import TYPE_CHECKING
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
from typing import TYPE_CHECKING
|
|
25
|
+
|
|
26
|
+
try:
|
|
27
|
+
import MySQLdb
|
|
28
|
+
except ImportError:
|
|
29
|
+
raise RuntimeError(
|
|
30
|
+
"You do not have `mysqlclient` package installed. "
|
|
31
|
+
"Please install it with `pip install mysqlclient` and make sure you have system "
|
|
32
|
+
"mysql libraries installed, as well as well as `pkg-config` system package "
|
|
33
|
+
"installed in case you see compilation error during installation."
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
from airflow.providers.common.compat.sdk import BaseOperator
|
|
28
37
|
from airflow.providers.mysql.hooks.mysql import MySqlHook
|
|
29
38
|
from airflow.providers.vertica.hooks.vertica import VerticaHook
|
|
30
39
|
|
|
31
40
|
if TYPE_CHECKING:
|
|
32
|
-
from airflow.
|
|
41
|
+
from airflow.providers.common.compat.sdk import Context
|
|
33
42
|
|
|
34
43
|
|
|
35
44
|
class VerticaToMySqlOperator(BaseOperator):
|
|
@@ -133,21 +142,20 @@ class VerticaToMySqlOperator(BaseOperator):
|
|
|
133
142
|
count += 1
|
|
134
143
|
|
|
135
144
|
tmpfile.flush()
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
raise
|
|
145
|
+
self._run_preoperator(mysql)
|
|
146
|
+
try:
|
|
147
|
+
self.log.info("Bulk inserting rows into MySQL...")
|
|
148
|
+
with closing(mysql.get_conn()) as conn2, closing(conn2.cursor()) as cursor2:
|
|
149
|
+
cursor2.execute(
|
|
150
|
+
f"LOAD DATA LOCAL INFILE '{tmpfile.name}' "
|
|
151
|
+
f"INTO TABLE {self.mysql_table} "
|
|
152
|
+
f"LINES TERMINATED BY '\r\n' ({', '.join(selected_columns)})"
|
|
153
|
+
)
|
|
154
|
+
conn2.commit()
|
|
155
|
+
self.log.info("Inserted rows into MySQL %s", count)
|
|
156
|
+
except (MySQLdb.Error, MySQLdb.Warning):
|
|
157
|
+
self.log.info("Inserted rows into MySQL 0")
|
|
158
|
+
raise
|
|
151
159
|
|
|
152
160
|
def _run_preoperator(self, mysql):
|
|
153
161
|
if self.mysql_preoperator:
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
|
3
|
+
# distributed with this work for additional information
|
|
4
|
+
# regarding copyright ownership. The ASF licenses this file
|
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
|
6
|
+
# "License"); you may not use this file except in compliance
|
|
7
|
+
# with the License. You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
|
12
|
+
# software distributed under the License is distributed on an
|
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
# KIND, either express or implied. See the License for the
|
|
15
|
+
# specific language governing permissions and limitations
|
|
16
|
+
# under the License.
|
|
17
|
+
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def get_base_airflow_version_tuple() -> tuple[int, int, int]:
|
|
22
|
+
from packaging.version import Version
|
|
23
|
+
|
|
24
|
+
from airflow import __version__
|
|
25
|
+
|
|
26
|
+
airflow_version = Version(__version__)
|
|
27
|
+
return airflow_version.major, airflow_version.minor, airflow_version.micro
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
AIRFLOW_V_3_0_PLUS = get_base_airflow_version_tuple() >= (3, 0, 0)
|
|
31
|
+
|
|
32
|
+
__all__ = [
|
|
33
|
+
"AIRFLOW_V_3_0_PLUS",
|
|
34
|
+
]
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: apache-airflow-providers-mysql
|
|
3
|
-
Version:
|
|
3
|
+
Version: 6.4.1rc1
|
|
4
4
|
Summary: Provider package apache-airflow-providers-mysql for Apache Airflow
|
|
5
5
|
Keywords: airflow-provider,mysql,airflow,integration
|
|
6
6
|
Author-email: Apache Software Foundation <dev@airflow.apache.org>
|
|
7
7
|
Maintainer-email: Apache Software Foundation <dev@airflow.apache.org>
|
|
8
|
-
Requires-Python:
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
9
|
Description-Content-Type: text/x-rst
|
|
10
|
+
License-Expression: Apache-2.0
|
|
10
11
|
Classifier: Development Status :: 5 - Production/Stable
|
|
11
12
|
Classifier: Environment :: Console
|
|
12
13
|
Classifier: Environment :: Web Environment
|
|
@@ -14,31 +15,32 @@ Classifier: Intended Audience :: Developers
|
|
|
14
15
|
Classifier: Intended Audience :: System Administrators
|
|
15
16
|
Classifier: Framework :: Apache Airflow
|
|
16
17
|
Classifier: Framework :: Apache Airflow :: Provider
|
|
17
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
20
18
|
Classifier: Programming Language :: Python :: 3.10
|
|
21
19
|
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
22
|
Classifier: Topic :: System :: Monitoring
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Requires-Dist:
|
|
26
|
-
Requires-Dist:
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
License-File: NOTICE
|
|
25
|
+
Requires-Dist: apache-airflow>=2.11.0rc1
|
|
26
|
+
Requires-Dist: apache-airflow-providers-common-compat>=1.12.0rc1
|
|
27
|
+
Requires-Dist: apache-airflow-providers-common-sql>=1.20.0rc1
|
|
28
|
+
Requires-Dist: mysqlclient>=2.2.5; sys_platform != "darwin"
|
|
29
|
+
Requires-Dist: mysql-connector-python>=9.1.0
|
|
30
|
+
Requires-Dist: aiomysql>=0.2.0
|
|
27
31
|
Requires-Dist: apache-airflow-providers-amazon ; extra == "amazon"
|
|
28
|
-
Requires-Dist: apache-airflow-providers-common-sql ; extra == "common.sql"
|
|
29
32
|
Requires-Dist: apache-airflow-providers-openlineage ; extra == "openlineage"
|
|
30
33
|
Requires-Dist: apache-airflow-providers-presto ; extra == "presto"
|
|
31
34
|
Requires-Dist: apache-airflow-providers-trino ; extra == "trino"
|
|
32
35
|
Requires-Dist: apache-airflow-providers-vertica ; extra == "vertica"
|
|
33
36
|
Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
|
|
34
|
-
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-mysql/
|
|
35
|
-
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-mysql/
|
|
37
|
+
Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-mysql/6.4.1/changelog.html
|
|
38
|
+
Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-mysql/6.4.1
|
|
39
|
+
Project-URL: Mastodon, https://fosstodon.org/@airflow
|
|
36
40
|
Project-URL: Slack Chat, https://s.apache.org/airflow-slack
|
|
37
41
|
Project-URL: Source Code, https://github.com/apache/airflow
|
|
38
|
-
Project-URL: Twitter, https://twitter.com/ApacheAirflow
|
|
39
42
|
Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
|
|
40
43
|
Provides-Extra: amazon
|
|
41
|
-
Provides-Extra: common.sql
|
|
42
44
|
Provides-Extra: mysql-connector-python
|
|
43
45
|
Provides-Extra: openlineage
|
|
44
46
|
Provides-Extra: presto
|
|
@@ -63,33 +65,14 @@ Provides-Extra: vertica
|
|
|
63
65
|
specific language governing permissions and limitations
|
|
64
66
|
under the License.
|
|
65
67
|
|
|
66
|
-
|
|
67
|
-
or more contributor license agreements. See the NOTICE file
|
|
68
|
-
distributed with this work for additional information
|
|
69
|
-
regarding copyright ownership. The ASF licenses this file
|
|
70
|
-
to you under the Apache License, Version 2.0 (the
|
|
71
|
-
"License"); you may not use this file except in compliance
|
|
72
|
-
with the License. You may obtain a copy of the License at
|
|
73
|
-
|
|
74
|
-
.. http://www.apache.org/licenses/LICENSE-2.0
|
|
75
|
-
|
|
76
|
-
.. Unless required by applicable law or agreed to in writing,
|
|
77
|
-
software distributed under the License is distributed on an
|
|
78
|
-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
79
|
-
KIND, either express or implied. See the License for the
|
|
80
|
-
specific language governing permissions and limitations
|
|
81
|
-
under the License.
|
|
82
|
-
|
|
83
|
-
.. NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE
|
|
84
|
-
OVERWRITTEN WHEN PREPARING PACKAGES.
|
|
85
|
-
|
|
86
|
-
.. IF YOU WANT TO MODIFY TEMPLATE FOR THIS FILE, YOU SHOULD MODIFY THE TEMPLATE
|
|
87
|
-
`PROVIDER_README_TEMPLATE.rst.jinja2` IN the `dev/breeze/src/airflow_breeze/templates` DIRECTORY
|
|
68
|
+
.. NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN!
|
|
88
69
|
|
|
70
|
+
.. IF YOU WANT TO MODIFY TEMPLATE FOR THIS FILE, YOU SHOULD MODIFY THE TEMPLATE
|
|
71
|
+
``PROVIDER_README_TEMPLATE.rst.jinja2`` IN the ``dev/breeze/src/airflow_breeze/templates`` DIRECTORY
|
|
89
72
|
|
|
90
73
|
Package ``apache-airflow-providers-mysql``
|
|
91
74
|
|
|
92
|
-
Release: ``
|
|
75
|
+
Release: ``6.4.1``
|
|
93
76
|
|
|
94
77
|
|
|
95
78
|
`MySQL <https://www.mysql.com/>`__
|
|
@@ -102,34 +85,36 @@ This is a provider package for ``mysql`` provider. All classes for this provider
|
|
|
102
85
|
are in ``airflow.providers.mysql`` python package.
|
|
103
86
|
|
|
104
87
|
You can find package information and changelog for the provider
|
|
105
|
-
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-mysql/
|
|
88
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-mysql/6.4.1/>`_.
|
|
106
89
|
|
|
107
90
|
Installation
|
|
108
91
|
------------
|
|
109
92
|
|
|
110
|
-
You can install this package on top of an existing Airflow
|
|
93
|
+
You can install this package on top of an existing Airflow installation (see ``Requirements`` below
|
|
111
94
|
for the minimum Airflow version supported) via
|
|
112
95
|
``pip install apache-airflow-providers-mysql``
|
|
113
96
|
|
|
114
|
-
The package supports the following python versions: 3.
|
|
97
|
+
The package supports the following python versions: 3.10,3.11,3.12,3.13
|
|
115
98
|
|
|
116
99
|
Requirements
|
|
117
100
|
------------
|
|
118
101
|
|
|
119
|
-
|
|
120
|
-
PIP package
|
|
121
|
-
|
|
122
|
-
``apache-airflow``
|
|
123
|
-
``apache-airflow-providers-common-
|
|
124
|
-
``
|
|
125
|
-
``
|
|
126
|
-
|
|
102
|
+
========================================== =====================================
|
|
103
|
+
PIP package Version required
|
|
104
|
+
========================================== =====================================
|
|
105
|
+
``apache-airflow`` ``>=2.11.0``
|
|
106
|
+
``apache-airflow-providers-common-compat`` ``>=1.8.0``
|
|
107
|
+
``apache-airflow-providers-common-sql`` ``>=1.20.0``
|
|
108
|
+
``mysqlclient`` ``>=2.2.5; sys_platform != "darwin"``
|
|
109
|
+
``mysql-connector-python`` ``>=9.1.0``
|
|
110
|
+
``aiomysql`` ``>=0.2.0``
|
|
111
|
+
========================================== =====================================
|
|
127
112
|
|
|
128
113
|
Cross provider package dependencies
|
|
129
114
|
-----------------------------------
|
|
130
115
|
|
|
131
116
|
Those are dependencies that might be needed in order to use all the features of the package.
|
|
132
|
-
You need to install the specified
|
|
117
|
+
You need to install the specified providers in order to use them.
|
|
133
118
|
|
|
134
119
|
You can install such cross-provider dependencies when installing from PyPI. For example:
|
|
135
120
|
|
|
@@ -138,16 +123,32 @@ You can install such cross-provider dependencies when installing from PyPI. For
|
|
|
138
123
|
pip install apache-airflow-providers-mysql[amazon]
|
|
139
124
|
|
|
140
125
|
|
|
141
|
-
|
|
142
|
-
Dependent package
|
|
143
|
-
|
|
144
|
-
`apache-airflow-providers-amazon <https://airflow.apache.org/docs/apache-airflow-providers-amazon>`_
|
|
145
|
-
`apache-airflow-providers-common-
|
|
146
|
-
`apache-airflow-providers-
|
|
147
|
-
`apache-airflow-providers-
|
|
148
|
-
`apache-airflow-providers-
|
|
149
|
-
`apache-airflow-providers-
|
|
150
|
-
|
|
126
|
+
================================================================================================================== =================
|
|
127
|
+
Dependent package Extra
|
|
128
|
+
================================================================================================================== =================
|
|
129
|
+
`apache-airflow-providers-amazon <https://airflow.apache.org/docs/apache-airflow-providers-amazon>`_ ``amazon``
|
|
130
|
+
`apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
|
|
131
|
+
`apache-airflow-providers-common-sql <https://airflow.apache.org/docs/apache-airflow-providers-common-sql>`_ ``common.sql``
|
|
132
|
+
`apache-airflow-providers-openlineage <https://airflow.apache.org/docs/apache-airflow-providers-openlineage>`_ ``openlineage``
|
|
133
|
+
`apache-airflow-providers-presto <https://airflow.apache.org/docs/apache-airflow-providers-presto>`_ ``presto``
|
|
134
|
+
`apache-airflow-providers-trino <https://airflow.apache.org/docs/apache-airflow-providers-trino>`_ ``trino``
|
|
135
|
+
`apache-airflow-providers-vertica <https://airflow.apache.org/docs/apache-airflow-providers-vertica>`_ ``vertica``
|
|
136
|
+
================================================================================================================== =================
|
|
137
|
+
|
|
138
|
+
Optional dependencies
|
|
139
|
+
----------------------
|
|
140
|
+
|
|
141
|
+
========================== ========================================
|
|
142
|
+
Extra Dependencies
|
|
143
|
+
========================== ========================================
|
|
144
|
+
``mysql-connector-python``
|
|
145
|
+
``amazon`` ``apache-airflow-providers-amazon``
|
|
146
|
+
``openlineage`` ``apache-airflow-providers-openlineage``
|
|
147
|
+
``presto`` ``apache-airflow-providers-presto``
|
|
148
|
+
``trino`` ``apache-airflow-providers-trino``
|
|
149
|
+
``vertica`` ``apache-airflow-providers-vertica``
|
|
150
|
+
========================== ========================================
|
|
151
151
|
|
|
152
152
|
The changelog for the provider package can be found in the
|
|
153
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-mysql/
|
|
153
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-mysql/6.4.1/changelog.html>`_.
|
|
154
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
airflow/providers/mysql/__init__.py,sha256=zHx583tV_vZv5sTBvHoE0TOcll9Ptl6xOvmlxtwNj3U,1494
|
|
2
|
+
airflow/providers/mysql/get_provider_info.py,sha256=LNQZ8O48srWzGjS8mzLeAsa-VFGFY6ypkHK1jjr6umc,3064
|
|
3
|
+
airflow/providers/mysql/version_compat.py,sha256=WjmnDM48kcYw3Je7Y3y2QW72dcq1nAhuuQb0EwxKJig,1197
|
|
4
|
+
airflow/providers/mysql/assets/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
5
|
+
airflow/providers/mysql/assets/mysql.py,sha256=ORHZmCa1AZAWwpF7GKH-8faqOKSohJvKtqRgfDnQRRc,1385
|
|
6
|
+
airflow/providers/mysql/hooks/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
|
7
|
+
airflow/providers/mysql/hooks/mysql.py,sha256=_933MwmGBLWrPxWeREtor8NaZVSA-44WOVF9QA3XSq4,16352
|
|
8
|
+
airflow/providers/mysql/transfers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
9
|
+
airflow/providers/mysql/transfers/presto_to_mysql.py,sha256=tD8IcBU9Bn-b9LC-g43QuV24Vi7ThfeLyB5HmJqp8zM,3331
|
|
10
|
+
airflow/providers/mysql/transfers/s3_to_mysql.py,sha256=E5Ldaj1rzhUeDKVTYo63VHAbVINcmzi1jZkUZRHTUXM,3938
|
|
11
|
+
airflow/providers/mysql/transfers/trino_to_mysql.py,sha256=gQapv53XpTeEOmro63nDZgN1H0qz9Ig2K5bOhaDDv6k,3313
|
|
12
|
+
airflow/providers/mysql/transfers/vertica_to_mysql.py,sha256=cVJqw3lncx4ZaicKjft9lR87sH-O54U-YlSgcppUDTU,6828
|
|
13
|
+
apache_airflow_providers_mysql-6.4.1rc1.dist-info/entry_points.txt,sha256=kIbWluJZ1LX9jo9pLkqbnu6DUgYpoGKXzmSvjT5czKM,101
|
|
14
|
+
apache_airflow_providers_mysql-6.4.1rc1.dist-info/licenses/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
|
|
15
|
+
apache_airflow_providers_mysql-6.4.1rc1.dist-info/licenses/NOTICE,sha256=_cWHznIoUSbLCY_KfmKqetlKlsoH0c2VBjmZjElAzuc,168
|
|
16
|
+
apache_airflow_providers_mysql-6.4.1rc1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
17
|
+
apache_airflow_providers_mysql-6.4.1rc1.dist-info/METADATA,sha256=xQ9EflUugsk2_BPVrKteHIkDdN6OlE9ebDi5LONLHAM,7526
|
|
18
|
+
apache_airflow_providers_mysql-6.4.1rc1.dist-info/RECORD,,
|
{airflow/providers/mysql → apache_airflow_providers_mysql-6.4.1rc1.dist-info/licenses}/LICENSE
RENAMED
|
@@ -199,55 +199,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
199
199
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
200
|
See the License for the specific language governing permissions and
|
|
201
201
|
limitations under the License.
|
|
202
|
-
|
|
203
|
-
============================================================================
|
|
204
|
-
APACHE AIRFLOW SUBCOMPONENTS:
|
|
205
|
-
|
|
206
|
-
The Apache Airflow project contains subcomponents with separate copyright
|
|
207
|
-
notices and license terms. Your use of the source code for the these
|
|
208
|
-
subcomponents is subject to the terms and conditions of the following
|
|
209
|
-
licenses.
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
========================================================================
|
|
213
|
-
Third party Apache 2.0 licenses
|
|
214
|
-
========================================================================
|
|
215
|
-
|
|
216
|
-
The following components are provided under the Apache 2.0 License.
|
|
217
|
-
See project link for details. The text of each license is also included
|
|
218
|
-
at licenses/LICENSE-[project].txt.
|
|
219
|
-
|
|
220
|
-
(ALv2 License) hue v4.3.0 (https://github.com/cloudera/hue/)
|
|
221
|
-
(ALv2 License) jqclock v2.3.0 (https://github.com/JohnRDOrazio/jQuery-Clock-Plugin)
|
|
222
|
-
(ALv2 License) bootstrap3-typeahead v4.0.2 (https://github.com/bassjobsen/Bootstrap-3-Typeahead)
|
|
223
|
-
(ALv2 License) connexion v2.7.0 (https://github.com/zalando/connexion)
|
|
224
|
-
|
|
225
|
-
========================================================================
|
|
226
|
-
MIT licenses
|
|
227
|
-
========================================================================
|
|
228
|
-
|
|
229
|
-
The following components are provided under the MIT License. See project link for details.
|
|
230
|
-
The text of each license is also included at licenses/LICENSE-[project].txt.
|
|
231
|
-
|
|
232
|
-
(MIT License) jquery v3.5.1 (https://jquery.org/license/)
|
|
233
|
-
(MIT License) dagre-d3 v0.6.4 (https://github.com/cpettitt/dagre-d3)
|
|
234
|
-
(MIT License) bootstrap v3.4.1 (https://github.com/twbs/bootstrap/)
|
|
235
|
-
(MIT License) d3-tip v0.9.1 (https://github.com/Caged/d3-tip)
|
|
236
|
-
(MIT License) dataTables v1.10.25 (https://datatables.net)
|
|
237
|
-
(MIT License) normalize.css v3.0.2 (http://necolas.github.io/normalize.css/)
|
|
238
|
-
(MIT License) ElasticMock v1.3.2 (https://github.com/vrcmarcos/elasticmock)
|
|
239
|
-
(MIT License) MomentJS v2.24.0 (http://momentjs.com/)
|
|
240
|
-
(MIT License) eonasdan-bootstrap-datetimepicker v4.17.49 (https://github.com/eonasdan/bootstrap-datetimepicker/)
|
|
241
|
-
|
|
242
|
-
========================================================================
|
|
243
|
-
BSD 3-Clause licenses
|
|
244
|
-
========================================================================
|
|
245
|
-
The following components are provided under the BSD 3-Clause license. See project links for details.
|
|
246
|
-
The text of each license is also included at licenses/LICENSE-[project].txt.
|
|
247
|
-
|
|
248
|
-
(BSD 3 License) d3 v5.16.0 (https://d3js.org)
|
|
249
|
-
(BSD 3 License) d3-shape v2.1.0 (https://github.com/d3/d3-shape)
|
|
250
|
-
(BSD 3 License) cgroupspy 0.2.1 (https://github.com/cloudsigma/cgroupspy)
|
|
251
|
-
|
|
252
|
-
========================================================================
|
|
253
|
-
See licenses/LICENSES-ui.txt for packages used in `/airflow/www`
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
# Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
-
# or more contributor license agreements. See the NOTICE file
|
|
4
|
-
# distributed with this work for additional information
|
|
5
|
-
# regarding copyright ownership. The ASF licenses this file
|
|
6
|
-
# to you under the Apache License, Version 2.0 (the
|
|
7
|
-
# "License"); you may not use this file except in compliance
|
|
8
|
-
# with the License. You may obtain a copy of the License at
|
|
9
|
-
#
|
|
10
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
#
|
|
12
|
-
# Unless required by applicable law or agreed to in writing,
|
|
13
|
-
# software distributed under the License is distributed on an
|
|
14
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
-
# KIND, either express or implied. See the License for the
|
|
16
|
-
# specific language governing permissions and limitations
|
|
17
|
-
# under the License.
|
|
18
|
-
from __future__ import annotations
|
|
19
|
-
|
|
20
|
-
import warnings
|
|
21
|
-
from typing import Sequence
|
|
22
|
-
|
|
23
|
-
from airflow.exceptions import AirflowProviderDeprecationWarning
|
|
24
|
-
from airflow.providers.common.sql.operators.sql import SQLExecuteQueryOperator
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class MySqlOperator(SQLExecuteQueryOperator):
|
|
28
|
-
"""
|
|
29
|
-
Executes sql code in a specific MySQL database.
|
|
30
|
-
|
|
31
|
-
This class is deprecated.
|
|
32
|
-
|
|
33
|
-
Please use :class:`airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator`.
|
|
34
|
-
|
|
35
|
-
.. seealso::
|
|
36
|
-
For more information on how to use this operator, take a look at the guide:
|
|
37
|
-
:ref:`howto/operator:MySqlOperator`
|
|
38
|
-
|
|
39
|
-
:param sql: the sql code to be executed. Can receive a str representing a
|
|
40
|
-
sql statement, a list of str (sql statements), or reference to a template file.
|
|
41
|
-
Template reference are recognized by str ending in '.sql'
|
|
42
|
-
(templated)
|
|
43
|
-
:param mysql_conn_id: Reference to :ref:`mysql connection id <howto/connection:mysql>`.
|
|
44
|
-
:param parameters: (optional) the parameters to render the SQL query with.
|
|
45
|
-
Template reference are recognized by str ending in '.json'
|
|
46
|
-
(templated)
|
|
47
|
-
:param autocommit: if True, each command is automatically committed.
|
|
48
|
-
(default value: False)
|
|
49
|
-
:param database: name of database which overwrite defined one in connection
|
|
50
|
-
"""
|
|
51
|
-
|
|
52
|
-
template_fields: Sequence[str] = ("sql", "parameters")
|
|
53
|
-
template_fields_renderers = {
|
|
54
|
-
"sql": "mysql",
|
|
55
|
-
"parameters": "json",
|
|
56
|
-
}
|
|
57
|
-
template_ext: Sequence[str] = (".sql", ".json")
|
|
58
|
-
ui_color = "#ededed"
|
|
59
|
-
|
|
60
|
-
def __init__(
|
|
61
|
-
self, *, mysql_conn_id: str = "mysql_default", database: str | None = None, **kwargs
|
|
62
|
-
) -> None:
|
|
63
|
-
if database is not None:
|
|
64
|
-
hook_params = kwargs.pop("hook_params", {})
|
|
65
|
-
kwargs["hook_params"] = {"schema": database, **hook_params}
|
|
66
|
-
|
|
67
|
-
super().__init__(conn_id=mysql_conn_id, **kwargs)
|
|
68
|
-
warnings.warn(
|
|
69
|
-
"""This class is deprecated.
|
|
70
|
-
Please use `airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator`.
|
|
71
|
-
Also, you can provide `hook_params={'schema': <database>}`.""",
|
|
72
|
-
AirflowProviderDeprecationWarning,
|
|
73
|
-
stacklevel=2,
|
|
74
|
-
)
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
airflow/providers/mysql/LICENSE,sha256=ywUBpKZc7Jb96rVt5I3IDbg7dIJAbUSHkuoDcF3jbH4,13569
|
|
2
|
-
airflow/providers/mysql/__init__.py,sha256=A3nw7rd0_tvolTfM6b6_f6C9GtM8AuHwsXqdGKEKofY,1580
|
|
3
|
-
airflow/providers/mysql/get_provider_info.py,sha256=lIIJskLs55UgDZvmGXwAczq_VLqXmKEIhUoQpLUO8fY,3988
|
|
4
|
-
airflow/providers/mysql/hooks/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
|
5
|
-
airflow/providers/mysql/hooks/mysql.py,sha256=t2EkCHr_Prv8yKPF1XKOFnbpsTKMkMSkqlHrZkRtYxw,13217
|
|
6
|
-
airflow/providers/mysql/operators/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
|
7
|
-
airflow/providers/mysql/operators/mysql.py,sha256=Vuct5Aa5mf51HH5r7IFC42OR3gtlLY5gNcDBu_gbAFI,2987
|
|
8
|
-
airflow/providers/mysql/transfers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
9
|
-
airflow/providers/mysql/transfers/presto_to_mysql.py,sha256=gGtZIGXLpY2jP8o3xwZ5u8khqcQK3cVSa9P-aev7Qiw,3269
|
|
10
|
-
airflow/providers/mysql/transfers/s3_to_mysql.py,sha256=j2t2pIZkWnPbNiBbhpxTfKXIUu7TnTe66kT3K3OotRw,3870
|
|
11
|
-
airflow/providers/mysql/transfers/trino_to_mysql.py,sha256=wiiuilxSHchJD0W2K838UHH5iUs-R5HNc0zyRDOZDRs,3251
|
|
12
|
-
airflow/providers/mysql/transfers/vertica_to_mysql.py,sha256=NiIFMv0zy4M9Ynrs4InG9nqp6lyvmgDlz7_iDJWxQEI,6308
|
|
13
|
-
apache_airflow_providers_mysql-5.5.2.dist-info/entry_points.txt,sha256=kIbWluJZ1LX9jo9pLkqbnu6DUgYpoGKXzmSvjT5czKM,101
|
|
14
|
-
apache_airflow_providers_mysql-5.5.2.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
15
|
-
apache_airflow_providers_mysql-5.5.2.dist-info/METADATA,sha256=ekUnNTTSwuytO0JcbvakV1h1KI2oymdoA7L0n9Hvvc4,7270
|
|
16
|
-
apache_airflow_providers_mysql-5.5.2.dist-info/RECORD,,
|