apache-airflow-providers-common-sql 1.14.2rc1__tar.gz → 1.15.0__tar.gz
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-common-sql might be problematic. Click here for more details.
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/PKG-INFO +7 -7
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/README.rst +3 -3
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/airflow/providers/common/sql/__init__.py +1 -1
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/airflow/providers/common/sql/get_provider_info.py +2 -1
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/airflow/providers/common/sql/hooks/sql.py +20 -3
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/airflow/providers/common/sql/hooks/sql.pyi +4 -2
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/pyproject.toml +4 -4
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/airflow/providers/common/sql/LICENSE +0 -0
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/airflow/providers/common/sql/README_API.md +0 -0
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/airflow/providers/common/sql/doc/adr/0001-record-architecture-decisions.md +0 -0
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/airflow/providers/common/sql/doc/adr/0002-return-common-data-structure-from-dbapihook-derived-hooks.md +0 -0
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/airflow/providers/common/sql/hooks/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/airflow/providers/common/sql/operators/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/airflow/providers/common/sql/operators/sql.py +0 -0
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/airflow/providers/common/sql/operators/sql.pyi +0 -0
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/airflow/providers/common/sql/sensors/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/airflow/providers/common/sql/sensors/sql.py +0 -0
- {apache_airflow_providers_common_sql-1.14.2rc1 → apache_airflow_providers_common_sql-1.15.0}/airflow/providers/common/sql/sensors/sql.pyi +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: apache-airflow-providers-common-sql
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.15.0
|
|
4
4
|
Summary: Provider package apache-airflow-providers-common-sql for Apache Airflow
|
|
5
5
|
Keywords: airflow-provider,common.sql,airflow,integration
|
|
6
6
|
Author-email: Apache Software Foundation <dev@airflow.apache.org>
|
|
@@ -21,15 +21,15 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.12
|
|
23
23
|
Classifier: Topic :: System :: Monitoring
|
|
24
|
-
Requires-Dist: apache-airflow>=2.7.
|
|
24
|
+
Requires-Dist: apache-airflow>=2.7.0
|
|
25
25
|
Requires-Dist: more-itertools>=9.0.0
|
|
26
26
|
Requires-Dist: sqlparse>=0.4.2
|
|
27
27
|
Requires-Dist: apache-airflow-providers-openlineage ; extra == "openlineage"
|
|
28
28
|
Requires-Dist: pandas>=2.1.2,<2.2 ; extra == "pandas" and (python_version>="3.9")
|
|
29
29
|
Requires-Dist: pandas>=1.5.3,<2.2 ; extra == "pandas" and (python_version<"3.9")
|
|
30
30
|
Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
|
|
31
|
-
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.
|
|
32
|
-
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.
|
|
31
|
+
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.15.0/changelog.html
|
|
32
|
+
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.15.0
|
|
33
33
|
Project-URL: Slack Chat, https://s.apache.org/airflow-slack
|
|
34
34
|
Project-URL: Source Code, https://github.com/apache/airflow
|
|
35
35
|
Project-URL: Twitter, https://twitter.com/ApacheAirflow
|
|
@@ -81,7 +81,7 @@ Provides-Extra: pandas
|
|
|
81
81
|
|
|
82
82
|
Package ``apache-airflow-providers-common-sql``
|
|
83
83
|
|
|
84
|
-
Release: ``1.
|
|
84
|
+
Release: ``1.15.0``
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
`Common SQL Provider <https://en.wikipedia.org/wiki/SQL>`__
|
|
@@ -94,7 +94,7 @@ This is a provider package for ``common.sql`` provider. All classes for this pro
|
|
|
94
94
|
are in ``airflow.providers.common.sql`` python package.
|
|
95
95
|
|
|
96
96
|
You can find package information and changelog for the provider
|
|
97
|
-
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.
|
|
97
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.15.0/>`_.
|
|
98
98
|
|
|
99
99
|
Installation
|
|
100
100
|
------------
|
|
@@ -136,4 +136,4 @@ Dependent package
|
|
|
136
136
|
============================================================================================================== ===============
|
|
137
137
|
|
|
138
138
|
The changelog for the provider package can be found in the
|
|
139
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.
|
|
139
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.15.0/changelog.html>`_.
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
Package ``apache-airflow-providers-common-sql``
|
|
44
44
|
|
|
45
|
-
Release: ``1.
|
|
45
|
+
Release: ``1.15.0``
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
`Common SQL Provider <https://en.wikipedia.org/wiki/SQL>`__
|
|
@@ -55,7 +55,7 @@ This is a provider package for ``common.sql`` provider. All classes for this pro
|
|
|
55
55
|
are in ``airflow.providers.common.sql`` python package.
|
|
56
56
|
|
|
57
57
|
You can find package information and changelog for the provider
|
|
58
|
-
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.
|
|
58
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.15.0/>`_.
|
|
59
59
|
|
|
60
60
|
Installation
|
|
61
61
|
------------
|
|
@@ -97,4 +97,4 @@ Dependent package
|
|
|
97
97
|
============================================================================================================== ===============
|
|
98
98
|
|
|
99
99
|
The changelog for the provider package can be found in the
|
|
100
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.
|
|
100
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.15.0/changelog.html>`_.
|
|
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
|
|
|
29
29
|
|
|
30
30
|
__all__ = ["__version__"]
|
|
31
31
|
|
|
32
|
-
__version__ = "1.
|
|
32
|
+
__version__ = "1.15.0"
|
|
33
33
|
|
|
34
34
|
if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
|
|
35
35
|
"2.7.0"
|
|
@@ -28,8 +28,9 @@ def get_provider_info():
|
|
|
28
28
|
"name": "Common SQL",
|
|
29
29
|
"description": "`Common SQL Provider <https://en.wikipedia.org/wiki/SQL>`__\n",
|
|
30
30
|
"state": "ready",
|
|
31
|
-
"source-date-epoch":
|
|
31
|
+
"source-date-epoch": 1722663378,
|
|
32
32
|
"versions": [
|
|
33
|
+
"1.15.0",
|
|
33
34
|
"1.14.2",
|
|
34
35
|
"1.14.1",
|
|
35
36
|
"1.14.0",
|
|
@@ -40,6 +40,7 @@ from urllib.parse import urlparse
|
|
|
40
40
|
import sqlparse
|
|
41
41
|
from more_itertools import chunked
|
|
42
42
|
from sqlalchemy import create_engine
|
|
43
|
+
from sqlalchemy.engine import Inspector
|
|
43
44
|
|
|
44
45
|
from airflow.exceptions import (
|
|
45
46
|
AirflowException,
|
|
@@ -242,7 +243,20 @@ class DbApiHook(BaseHook):
|
|
|
242
243
|
"""
|
|
243
244
|
if engine_kwargs is None:
|
|
244
245
|
engine_kwargs = {}
|
|
245
|
-
|
|
246
|
+
engine_kwargs["creator"] = self.get_conn
|
|
247
|
+
|
|
248
|
+
try:
|
|
249
|
+
url = self.sqlalchemy_url
|
|
250
|
+
except NotImplementedError:
|
|
251
|
+
url = self.get_uri()
|
|
252
|
+
|
|
253
|
+
self.log.debug("url: %s", url)
|
|
254
|
+
self.log.debug("engine_kwargs: %s", engine_kwargs)
|
|
255
|
+
return create_engine(url=url, **engine_kwargs)
|
|
256
|
+
|
|
257
|
+
@property
|
|
258
|
+
def inspector(self) -> Inspector:
|
|
259
|
+
return Inspector.from_engine(self.get_sqlalchemy_engine())
|
|
246
260
|
|
|
247
261
|
def get_pandas_df(
|
|
248
262
|
self,
|
|
@@ -571,6 +585,7 @@ class DbApiHook(BaseHook):
|
|
|
571
585
|
replace=False,
|
|
572
586
|
*,
|
|
573
587
|
executemany=False,
|
|
588
|
+
autocommit=False,
|
|
574
589
|
**kwargs,
|
|
575
590
|
):
|
|
576
591
|
"""
|
|
@@ -585,12 +600,14 @@ class DbApiHook(BaseHook):
|
|
|
585
600
|
:param commit_every: The maximum number of rows to insert in one
|
|
586
601
|
transaction. Set to 0 to insert all rows in one transaction.
|
|
587
602
|
:param replace: Whether to replace instead of insert
|
|
588
|
-
:param executemany:
|
|
603
|
+
:param executemany: If True, all rows are inserted at once in
|
|
589
604
|
chunks defined by the commit_every parameter. This only works if all rows
|
|
590
605
|
have same number of column names, but leads to better performance.
|
|
606
|
+
:param autocommit: What to set the connection's autocommit setting to
|
|
607
|
+
before executing the query.
|
|
591
608
|
"""
|
|
592
609
|
nb_rows = 0
|
|
593
|
-
with self._create_autocommit_connection() as conn:
|
|
610
|
+
with self._create_autocommit_connection(autocommit) as conn:
|
|
594
611
|
conn.commit()
|
|
595
612
|
with closing(conn.cursor()) as cur:
|
|
596
613
|
if self.supports_executemany or executemany:
|
|
@@ -42,7 +42,7 @@ from airflow.providers.openlineage.extractors import OperatorLineage as Operator
|
|
|
42
42
|
from airflow.providers.openlineage.sqlparser import DatabaseInfo as DatabaseInfo
|
|
43
43
|
from functools import cached_property as cached_property
|
|
44
44
|
from pandas import DataFrame as DataFrame
|
|
45
|
-
from sqlalchemy.engine import URL as URL
|
|
45
|
+
from sqlalchemy.engine import Inspector, URL as URL
|
|
46
46
|
from typing import Any, Callable, Generator, Iterable, Mapping, Protocol, Sequence, TypeVar, overload
|
|
47
47
|
|
|
48
48
|
T = TypeVar("T")
|
|
@@ -64,7 +64,6 @@ class DbApiHook(BaseHook):
|
|
|
64
64
|
log_sql: Incomplete
|
|
65
65
|
descriptions: Incomplete
|
|
66
66
|
def __init__(self, *args, schema: str | None = None, log_sql: bool = True, **kwargs) -> None: ...
|
|
67
|
-
|
|
68
67
|
def get_conn_id(self) -> str: ...
|
|
69
68
|
@cached_property
|
|
70
69
|
def placeholder(self): ...
|
|
@@ -73,6 +72,8 @@ class DbApiHook(BaseHook):
|
|
|
73
72
|
@property
|
|
74
73
|
def sqlalchemy_url(self) -> URL: ...
|
|
75
74
|
def get_sqlalchemy_engine(self, engine_kwargs: Incomplete | None = None): ...
|
|
75
|
+
@property
|
|
76
|
+
def inspector(self) -> Inspector: ...
|
|
76
77
|
def get_pandas_df(
|
|
77
78
|
self, sql, parameters: list | tuple | Mapping[str, Any] | None = None, **kwargs
|
|
78
79
|
) -> DataFrame: ...
|
|
@@ -123,6 +124,7 @@ class DbApiHook(BaseHook):
|
|
|
123
124
|
replace: bool = False,
|
|
124
125
|
*,
|
|
125
126
|
executemany: bool = False,
|
|
127
|
+
autocommit: bool = False,
|
|
126
128
|
**kwargs,
|
|
127
129
|
): ...
|
|
128
130
|
def bulk_dump(self, table, tmp_file) -> None: ...
|
|
@@ -28,7 +28,7 @@ build-backend = "flit_core.buildapi"
|
|
|
28
28
|
|
|
29
29
|
[project]
|
|
30
30
|
name = "apache-airflow-providers-common-sql"
|
|
31
|
-
version = "1.
|
|
31
|
+
version = "1.15.0"
|
|
32
32
|
description = "Provider package apache-airflow-providers-common-sql for Apache Airflow"
|
|
33
33
|
readme = "README.rst"
|
|
34
34
|
authors = [
|
|
@@ -56,14 +56,14 @@ classifiers = [
|
|
|
56
56
|
]
|
|
57
57
|
requires-python = "~=3.8"
|
|
58
58
|
dependencies = [
|
|
59
|
-
"apache-airflow>=2.7.
|
|
59
|
+
"apache-airflow>=2.7.0",
|
|
60
60
|
"more-itertools>=9.0.0",
|
|
61
61
|
"sqlparse>=0.4.2",
|
|
62
62
|
]
|
|
63
63
|
|
|
64
64
|
[project.urls]
|
|
65
|
-
"Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.
|
|
66
|
-
"Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.
|
|
65
|
+
"Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.15.0"
|
|
66
|
+
"Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.15.0/changelog.html"
|
|
67
67
|
"Bug Tracker" = "https://github.com/apache/airflow/issues"
|
|
68
68
|
"Source Code" = "https://github.com/apache/airflow"
|
|
69
69
|
"Slack Chat" = "https://s.apache.org/airflow-slack"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|