apache-airflow-providers-mysql 5.7.4__py3-none-any.whl → 6.0.0__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.
@@ -29,11 +29,11 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "5.7.4"
32
+ __version__ = "6.0.0"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
- "2.8.0"
35
+ "2.9.0"
36
36
  ):
37
37
  raise RuntimeError(
38
- f"The package `apache-airflow-providers-mysql:{__version__}` needs Apache Airflow 2.8.0+"
38
+ f"The package `apache-airflow-providers-mysql:{__version__}` needs Apache Airflow 2.9.0+"
39
39
  )
@@ -28,8 +28,9 @@ def get_provider_info():
28
28
  "name": "MySQL",
29
29
  "description": "`MySQL <https://www.mysql.com/>`__\n",
30
30
  "state": "ready",
31
- "source-date-epoch": 1731570417,
31
+ "source-date-epoch": 1734535570,
32
32
  "versions": [
33
+ "6.0.0",
33
34
  "5.7.4",
34
35
  "5.7.3",
35
36
  "5.7.2",
@@ -74,10 +75,11 @@ def get_provider_info():
74
75
  "1.0.0",
75
76
  ],
76
77
  "dependencies": [
77
- "apache-airflow>=2.8.0",
78
+ "apache-airflow>=2.9.0",
78
79
  "apache-airflow-providers-common-sql>=1.20.0",
79
80
  "mysqlclient>=1.4.0; sys_platform != 'darwin'",
80
81
  "mysql-connector-python>=8.0.29",
82
+ "aiomysql>=0.2.0",
81
83
  ],
82
84
  "additional-extras": [{"name": "mysql-connector-python", "dependencies": []}],
83
85
  "integrations": [
@@ -89,9 +91,6 @@ def get_provider_info():
89
91
  "tags": ["software"],
90
92
  }
91
93
  ],
92
- "operators": [
93
- {"integration-name": "MySQL", "python-modules": ["airflow.providers.mysql.operators.mysql"]}
94
- ],
95
94
  "hooks": [{"integration-name": "MySQL", "python-modules": ["airflow.providers.mysql.hooks.mysql"]}],
96
95
  "transfers": [
97
96
  {
@@ -17,7 +17,8 @@
17
17
  # under the License.
18
18
  from __future__ import annotations
19
19
 
20
- from typing import TYPE_CHECKING, Sequence
20
+ from collections.abc import Sequence
21
+ from typing import TYPE_CHECKING
21
22
 
22
23
  from airflow.models import BaseOperator
23
24
  from airflow.providers.mysql.hooks.mysql import MySqlHook
@@ -17,7 +17,8 @@
17
17
  from __future__ import annotations
18
18
 
19
19
  import os
20
- from typing import TYPE_CHECKING, Sequence
20
+ from collections.abc import Sequence
21
+ from typing import TYPE_CHECKING
21
22
 
22
23
  from airflow.models import BaseOperator
23
24
  from airflow.providers.amazon.aws.hooks.s3 import S3Hook
@@ -17,7 +17,8 @@
17
17
  # under the License.
18
18
  from __future__ import annotations
19
19
 
20
- from typing import TYPE_CHECKING, Sequence
20
+ from collections.abc import Sequence
21
+ from typing import TYPE_CHECKING
21
22
 
22
23
  from airflow.models import BaseOperator
23
24
  from airflow.providers.mysql.hooks.mysql import MySqlHook
@@ -18,9 +18,10 @@
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, Sequence
24
+ from typing import TYPE_CHECKING
24
25
 
25
26
  try:
26
27
  import MySQLdb
@@ -141,21 +142,20 @@ class VerticaToMySqlOperator(BaseOperator):
141
142
  count += 1
142
143
 
143
144
  tmpfile.flush()
144
- self._run_preoperator(mysql)
145
- try:
146
- self.log.info("Bulk inserting rows into MySQL...")
147
- with closing(mysql.get_conn()) as conn, closing(conn.cursor()) as cursor:
148
- cursor.execute(
149
- f"LOAD DATA LOCAL INFILE '{tmpfile.name}' "
150
- f"INTO TABLE {self.mysql_table} "
151
- f"LINES TERMINATED BY '\r\n' ({', '.join(selected_columns)})"
152
- )
153
- conn.commit()
154
- tmpfile.close()
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
145
+ self._run_preoperator(mysql)
146
+ try:
147
+ self.log.info("Bulk inserting rows into MySQL...")
148
+ with closing(mysql.get_conn()) as conn, closing(conn.cursor()) as cursor:
149
+ cursor.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
+ conn.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
159
159
 
160
160
  def _run_preoperator(self, mysql):
161
161
  if self.mysql_preoperator:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: apache-airflow-providers-mysql
3
- Version: 5.7.4
3
+ Version: 6.0.0
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>
@@ -20,25 +20,24 @@ Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Topic :: System :: Monitoring
23
+ Requires-Dist: aiomysql>=0.2.0
23
24
  Requires-Dist: apache-airflow-providers-common-sql>=1.20.0
24
- Requires-Dist: apache-airflow>=2.8.0
25
+ Requires-Dist: apache-airflow>=2.9.0
25
26
  Requires-Dist: mysql-connector-python>=8.0.29
26
27
  Requires-Dist: mysqlclient>=1.4.0; sys_platform != 'darwin'
27
28
  Requires-Dist: apache-airflow-providers-amazon ; extra == "amazon"
28
- Requires-Dist: apache-airflow-providers-common-sql ; extra == "common-sql"
29
29
  Requires-Dist: apache-airflow-providers-openlineage ; extra == "openlineage"
30
30
  Requires-Dist: apache-airflow-providers-presto ; extra == "presto"
31
31
  Requires-Dist: apache-airflow-providers-trino ; extra == "trino"
32
32
  Requires-Dist: apache-airflow-providers-vertica ; extra == "vertica"
33
33
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
34
- Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-mysql/5.7.4/changelog.html
35
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-mysql/5.7.4
34
+ Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-mysql/6.0.0/changelog.html
35
+ Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-mysql/6.0.0
36
36
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
37
37
  Project-URL: Source Code, https://github.com/apache/airflow
38
- Project-URL: Twitter, https://twitter.com/ApacheAirflow
38
+ Project-URL: Twitter, https://x.com/ApacheAirflow
39
39
  Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
40
40
  Provides-Extra: amazon
41
- Provides-Extra: common-sql
42
41
  Provides-Extra: mysql-connector-python
43
42
  Provides-Extra: openlineage
44
43
  Provides-Extra: presto
@@ -89,7 +88,7 @@ Provides-Extra: vertica
89
88
 
90
89
  Package ``apache-airflow-providers-mysql``
91
90
 
92
- Release: ``5.7.4``
91
+ Release: ``6.0.0``
93
92
 
94
93
 
95
94
  `MySQL <https://www.mysql.com/>`__
@@ -102,7 +101,7 @@ This is a provider package for ``mysql`` provider. All classes for this provider
102
101
  are in ``airflow.providers.mysql`` python package.
103
102
 
104
103
  You can find package information and changelog for the provider
105
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-mysql/5.7.4/>`_.
104
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-mysql/6.0.0/>`_.
106
105
 
107
106
  Installation
108
107
  ------------
@@ -119,10 +118,11 @@ Requirements
119
118
  ======================================= =====================================
120
119
  PIP package Version required
121
120
  ======================================= =====================================
122
- ``apache-airflow`` ``>=2.8.0``
121
+ ``apache-airflow`` ``>=2.9.0``
123
122
  ``apache-airflow-providers-common-sql`` ``>=1.20.0``
124
123
  ``mysqlclient`` ``>=1.4.0; sys_platform != "darwin"``
125
124
  ``mysql-connector-python`` ``>=8.0.29``
125
+ ``aiomysql`` ``>=0.2.0``
126
126
  ======================================= =====================================
127
127
 
128
128
  Cross provider package dependencies
@@ -150,4 +150,4 @@ Dependent package
150
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/5.7.4/changelog.html>`_.
153
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-mysql/6.0.0/changelog.html>`_.
@@ -0,0 +1,16 @@
1
+ airflow/providers/mysql/LICENSE,sha256=FFb4jd2AXnOOf7XLP04pQW6jbdhG49TxlGY6fFpCV1Y,13609
2
+ airflow/providers/mysql/__init__.py,sha256=EYtKrOJkkHb-FZ7sRMS81MCEA0WbzFGa-SIQRsxXMok,1492
3
+ airflow/providers/mysql/get_provider_info.py,sha256=glJ1gUXXuvU-l83i_49-B6R7K6QQrhCSjpd-CjXaeHc,4451
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=8KXPSWAbkO33Vlex_KjXHiFZimBHCp4gbOP8AvxJpNw,14623
8
+ airflow/providers/mysql/transfers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
9
+ airflow/providers/mysql/transfers/presto_to_mysql.py,sha256=N463GjZURc0KImyGMfCZiHOG44GDCXqmfTyCGSKEyTk,3296
10
+ airflow/providers/mysql/transfers/s3_to_mysql.py,sha256=mXiCZIuSBy1hZV9xyhEC2iMyMglTX14Tm2JQAzN-GlM,3903
11
+ airflow/providers/mysql/transfers/trino_to_mysql.py,sha256=uPasNfzlq_lNuEbYr_vYETdQL5IA0M5Bnbw6-Nx8RtI,3278
12
+ airflow/providers/mysql/transfers/vertica_to_mysql.py,sha256=uHeER3bsAmpWucwGkE7TzNWvlBAc85rw7oVtzuLwYqY,6788
13
+ apache_airflow_providers_mysql-6.0.0.dist-info/entry_points.txt,sha256=kIbWluJZ1LX9jo9pLkqbnu6DUgYpoGKXzmSvjT5czKM,101
14
+ apache_airflow_providers_mysql-6.0.0.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
15
+ apache_airflow_providers_mysql-6.0.0.dist-info/METADATA,sha256=PwPJelMqeHNmqkyrIMxdDgTxxkkVQ5-Z2lUkAMhv9ME,7359
16
+ apache_airflow_providers_mysql-6.0.0.dist-info/RECORD,,
@@ -1,17 +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.
@@ -1,75 +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
- from typing import ClassVar, Sequence
21
-
22
- from deprecated import deprecated
23
-
24
- from airflow.exceptions import AirflowProviderDeprecationWarning
25
- from airflow.providers.common.sql.operators.sql import SQLExecuteQueryOperator
26
-
27
-
28
- @deprecated(
29
- reason=(
30
- "Please use `airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator`."
31
- "Also, you can provide `hook_params={'schema': <database>}`."
32
- ),
33
- category=AirflowProviderDeprecationWarning,
34
- )
35
- class MySqlOperator(SQLExecuteQueryOperator):
36
- """
37
- Executes sql code in a specific MySQL database.
38
-
39
- This class is deprecated.
40
-
41
- Please use :class:`airflow.providers.common.sql.operators.sql.SQLExecuteQueryOperator`.
42
-
43
- .. seealso::
44
- For more information on how to use this operator, take a look at the guide:
45
- :ref:`howto/operator:mysql`
46
-
47
- :param sql: the sql code to be executed. Can receive a str representing a
48
- sql statement, a list of str (sql statements), or reference to a template file.
49
- Template reference are recognized by str ending in '.sql'
50
- (templated)
51
- :param mysql_conn_id: Reference to :ref:`mysql connection id <howto/connection:mysql>`.
52
- :param parameters: (optional) the parameters to render the SQL query with.
53
- Template reference are recognized by str ending in '.json'
54
- (templated)
55
- :param autocommit: if True, each command is automatically committed.
56
- (default value: False)
57
- :param database: name of database which overwrite defined one in connection
58
- """
59
-
60
- template_fields: Sequence[str] = ("sql", "parameters")
61
- template_fields_renderers: ClassVar[dict] = {
62
- "sql": "mysql",
63
- "parameters": "json",
64
- }
65
- template_ext: Sequence[str] = (".sql", ".json")
66
- ui_color = "#ededed"
67
-
68
- def __init__(
69
- self, *, mysql_conn_id: str = "mysql_default", database: str | None = None, **kwargs
70
- ) -> None:
71
- if database is not None:
72
- hook_params = kwargs.pop("hook_params", {})
73
- kwargs["hook_params"] = {"schema": database, **hook_params}
74
-
75
- super().__init__(conn_id=mysql_conn_id, **kwargs)
@@ -1,18 +0,0 @@
1
- airflow/providers/mysql/LICENSE,sha256=FFb4jd2AXnOOf7XLP04pQW6jbdhG49TxlGY6fFpCV1Y,13609
2
- airflow/providers/mysql/__init__.py,sha256=9liNxyPE42Ws-z8tZPUZRpPpw72PsIga8GD4RPGFSgI,1492
3
- airflow/providers/mysql/get_provider_info.py,sha256=QQr9ISI2nk_WBgP3pddQIhS3-jWrEtCgPUP3EljEuq0,4538
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=8KXPSWAbkO33Vlex_KjXHiFZimBHCp4gbOP8AvxJpNw,14623
8
- airflow/providers/mysql/operators/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
9
- airflow/providers/mysql/operators/mysql.py,sha256=4shjfLcSUn4d8eHfiQxBqN-XQHvQSr2audqgklfexmM,2952
10
- airflow/providers/mysql/transfers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
11
- airflow/providers/mysql/transfers/presto_to_mysql.py,sha256=gGtZIGXLpY2jP8o3xwZ5u8khqcQK3cVSa9P-aev7Qiw,3269
12
- airflow/providers/mysql/transfers/s3_to_mysql.py,sha256=E5I7QHWqzrG3Fi9AGklwZWRCVxVDOD1tOB2xHEOZUJw,3876
13
- airflow/providers/mysql/transfers/trino_to_mysql.py,sha256=wiiuilxSHchJD0W2K838UHH5iUs-R5HNc0zyRDOZDRs,3251
14
- airflow/providers/mysql/transfers/vertica_to_mysql.py,sha256=q2vjlvK4UfpBqFpixIs-xeEC5kxoc6j9EO8KqG-oRLo,6677
15
- apache_airflow_providers_mysql-5.7.4.dist-info/entry_points.txt,sha256=kIbWluJZ1LX9jo9pLkqbnu6DUgYpoGKXzmSvjT5czKM,101
16
- apache_airflow_providers_mysql-5.7.4.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
17
- apache_airflow_providers_mysql-5.7.4.dist-info/METADATA,sha256=fKsIl9irY7-fcN1gFVfiVgTyPYXTESCferxISaUcaNc,7383
18
- apache_airflow_providers_mysql-5.7.4.dist-info/RECORD,,