apache-airflow-providers-common-sql 1.27.0__tar.gz → 1.27.1__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.27.0 → apache_airflow_providers_common_sql-1.27.1}/PKG-INFO +6 -6
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/README.rst +3 -3
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/docs/changelog.rst +14 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/docs/index.rst +3 -3
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/provider.yaml +6 -2
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/pyproject.toml +3 -3
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/__init__.py +1 -1
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/hooks/sql.py +53 -11
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/hooks/sql.pyi +1 -78
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/sql/hooks/test_sql.py +20 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/docs/.latest-doc-only-change.txt +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/docs/commits.rst +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/docs/conf.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/docs/connections.rst +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/docs/dataframes.rst +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/docs/dialects.rst +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/docs/installing-providers-from-sources.rst +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/docs/integration-logos/sql.png +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/docs/operators.rst +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/docs/security.rst +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/docs/supported-database-types.rst +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/LICENSE +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/README_API.md +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/dialects/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/dialects/dialect.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/dialects/dialect.pyi +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/doc/adr/0001-record-architecture-decisions.md +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/doc/adr/0002-return-common-data-structure-from-dbapihook-derived-hooks.md +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/doc/adr/0003-introduce-notion-of-dialects-in-dbapihook.md +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/get_provider_info.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/get_provider_info.pyi +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/hooks/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/hooks/handlers.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/hooks/handlers.pyi +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/operators/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/operators/generic_transfer.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/operators/generic_transfer.pyi +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/operators/sql.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/sensors/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/sensors/sql.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/sensors/sql.pyi +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/triggers/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/triggers/sql.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/src/airflow/providers/common/sql/triggers/sql.pyi +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/conftest.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/system/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/system/common/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/system/common/sql/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/system/common/sql/example_generic_transfer.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/system/common/sql/example_sql_column_table_check.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/system/common/sql/example_sql_execute_query.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/system/common/sql/example_sql_threshold_check.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/sql/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/sql/dialects/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/sql/dialects/test_dialect.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/sql/hooks/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/sql/hooks/test_dbapi.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/sql/hooks/test_handlers.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/sql/hooks/test_sqlparse.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/sql/operators/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/sql/operators/test_generic_transfer.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/sql/operators/test_sql.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/sql/operators/test_sql_execute.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/sql/sensors/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/sql/sensors/test_sql.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/sql/triggers/__init__.py +0 -0
- {apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/tests/unit/common/sql/triggers/test_sql.py +0 -0
{apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: apache-airflow-providers-common-sql
|
|
3
|
-
Version: 1.27.
|
|
3
|
+
Version: 1.27.1
|
|
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>
|
|
@@ -28,8 +28,8 @@ Requires-Dist: apache-airflow-providers-openlineage ; extra == "openlineage"
|
|
|
28
28
|
Requires-Dist: pandas>=2.1.2,<2.2 ; extra == "pandas"
|
|
29
29
|
Requires-Dist: polars>=1.26.0 ; extra == "polars"
|
|
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.27.
|
|
32
|
-
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.27.
|
|
31
|
+
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.27.1/changelog.html
|
|
32
|
+
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.27.1
|
|
33
33
|
Project-URL: Mastodon, https://fosstodon.org/@airflow
|
|
34
34
|
Project-URL: Slack Chat, https://s.apache.org/airflow-slack
|
|
35
35
|
Project-URL: Source Code, https://github.com/apache/airflow
|
|
@@ -63,7 +63,7 @@ Provides-Extra: polars
|
|
|
63
63
|
|
|
64
64
|
Package ``apache-airflow-providers-common-sql``
|
|
65
65
|
|
|
66
|
-
Release: ``1.27.
|
|
66
|
+
Release: ``1.27.1``
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
`Common SQL Provider <https://en.wikipedia.org/wiki/SQL>`__
|
|
@@ -76,7 +76,7 @@ This is a provider package for ``common.sql`` provider. All classes for this pro
|
|
|
76
76
|
are in ``airflow.providers.common.sql`` python package.
|
|
77
77
|
|
|
78
78
|
You can find package information and changelog for the provider
|
|
79
|
-
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.27.
|
|
79
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.27.1/>`_.
|
|
80
80
|
|
|
81
81
|
Installation
|
|
82
82
|
------------
|
|
@@ -119,5 +119,5 @@ Dependent package
|
|
|
119
119
|
============================================================================================================== ===============
|
|
120
120
|
|
|
121
121
|
The changelog for the provider package can be found in the
|
|
122
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.27.
|
|
122
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.27.1/changelog.html>`_.
|
|
123
123
|
|
{apache_airflow_providers_common_sql-1.27.0 → apache_airflow_providers_common_sql-1.27.1}/README.rst
RENAMED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
Package ``apache-airflow-providers-common-sql``
|
|
25
25
|
|
|
26
|
-
Release: ``1.27.
|
|
26
|
+
Release: ``1.27.1``
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
`Common SQL Provider <https://en.wikipedia.org/wiki/SQL>`__
|
|
@@ -36,7 +36,7 @@ This is a provider package for ``common.sql`` provider. All classes for this pro
|
|
|
36
36
|
are in ``airflow.providers.common.sql`` python package.
|
|
37
37
|
|
|
38
38
|
You can find package information and changelog for the provider
|
|
39
|
-
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.27.
|
|
39
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.27.1/>`_.
|
|
40
40
|
|
|
41
41
|
Installation
|
|
42
42
|
------------
|
|
@@ -79,4 +79,4 @@ Dependent package
|
|
|
79
79
|
============================================================================================================== ===============
|
|
80
80
|
|
|
81
81
|
The changelog for the provider package can be found in the
|
|
82
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.27.
|
|
82
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.27.1/changelog.html>`_.
|
|
@@ -25,6 +25,20 @@
|
|
|
25
25
|
Changelog
|
|
26
26
|
---------
|
|
27
27
|
|
|
28
|
+
1.27.1
|
|
29
|
+
......
|
|
30
|
+
|
|
31
|
+
Misc
|
|
32
|
+
~~~~
|
|
33
|
+
|
|
34
|
+
* ``Update deprecated functions to use stable functions (#50275)``
|
|
35
|
+
* ``Update type to follow newest tpying spec (#50229)``
|
|
36
|
+
|
|
37
|
+
.. Below changes are excluded from the changelog. Move them to
|
|
38
|
+
appropriate section above if needed. Do not delete the lines(!):
|
|
39
|
+
* ``Update description of provider.yaml dependencies (#50231)``
|
|
40
|
+
* ``Add test for overload (#50200)``
|
|
41
|
+
|
|
28
42
|
1.27.0
|
|
29
43
|
......
|
|
30
44
|
|
|
@@ -79,7 +79,7 @@ apache-airflow-providers-common-sql package
|
|
|
79
79
|
`Common SQL Provider <https://en.wikipedia.org/wiki/SQL>`__
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
Release: 1.27.
|
|
82
|
+
Release: 1.27.1
|
|
83
83
|
|
|
84
84
|
Provider package
|
|
85
85
|
----------------
|
|
@@ -133,5 +133,5 @@ Downloading official packages
|
|
|
133
133
|
You can download officially released packages and verify their checksums and signatures from the
|
|
134
134
|
`Official Apache Download site <https://downloads.apache.org/airflow/providers/>`_
|
|
135
135
|
|
|
136
|
-
* `The apache-airflow-providers-common-sql 1.27.
|
|
137
|
-
* `The apache-airflow-providers-common-sql 1.27.
|
|
136
|
+
* `The apache-airflow-providers-common-sql 1.27.1 sdist package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_sql-1.27.1.tar.gz>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_sql-1.27.1.tar.gz.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_sql-1.27.1.tar.gz.sha512>`__)
|
|
137
|
+
* `The apache-airflow-providers-common-sql 1.27.1 wheel package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_sql-1.27.1-py3-none-any.whl>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_sql-1.27.1-py3-none-any.whl.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_common_sql-1.27.1-py3-none-any.whl.sha512>`__)
|
|
@@ -22,9 +22,13 @@ description: |
|
|
|
22
22
|
`Common SQL Provider <https://en.wikipedia.org/wiki/SQL>`__
|
|
23
23
|
|
|
24
24
|
state: ready
|
|
25
|
-
source-date-epoch:
|
|
26
|
-
#
|
|
25
|
+
source-date-epoch: 1747132237
|
|
26
|
+
# Note that those versions are maintained by release manager - do not update them manually
|
|
27
|
+
# with the exception of case where other provider in sources has >= new provider version.
|
|
28
|
+
# In such case adding >= NEW_VERSION and bumping to NEW_VERSION in a provider have
|
|
29
|
+
# to be done in the same PR
|
|
27
30
|
versions:
|
|
31
|
+
- 1.27.1
|
|
28
32
|
- 1.27.0
|
|
29
33
|
- 1.26.0
|
|
30
34
|
- 1.25.0
|
|
@@ -25,7 +25,7 @@ build-backend = "flit_core.buildapi"
|
|
|
25
25
|
|
|
26
26
|
[project]
|
|
27
27
|
name = "apache-airflow-providers-common-sql"
|
|
28
|
-
version = "1.27.
|
|
28
|
+
version = "1.27.1"
|
|
29
29
|
description = "Provider package apache-airflow-providers-common-sql for Apache Airflow"
|
|
30
30
|
readme = "README.rst"
|
|
31
31
|
authors = [
|
|
@@ -122,8 +122,8 @@ apache-airflow-providers-common-sql = {workspace = true}
|
|
|
122
122
|
apache-airflow-providers-standard = {workspace = true}
|
|
123
123
|
|
|
124
124
|
[project.urls]
|
|
125
|
-
"Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.27.
|
|
126
|
-
"Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.27.
|
|
125
|
+
"Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.27.1"
|
|
126
|
+
"Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-common-sql/1.27.1/changelog.html"
|
|
127
127
|
"Bug Tracker" = "https://github.com/apache/airflow/issues"
|
|
128
128
|
"Source Code" = "https://github.com/apache/airflow"
|
|
129
129
|
"Slack Chat" = "https://s.apache.org/airflow-slack"
|
|
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
|
|
|
29
29
|
|
|
30
30
|
__all__ = ["__version__"]
|
|
31
31
|
|
|
32
|
-
__version__ = "1.27.
|
|
32
|
+
__version__ = "1.27.1"
|
|
33
33
|
|
|
34
34
|
if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
|
|
35
35
|
"2.10.0"
|
|
@@ -54,7 +54,7 @@ from airflow.providers.common.sql.hooks import handlers
|
|
|
54
54
|
from airflow.utils.module_loading import import_string
|
|
55
55
|
|
|
56
56
|
if TYPE_CHECKING:
|
|
57
|
-
from pandas import DataFrame
|
|
57
|
+
from pandas import DataFrame as PandasDataFrame
|
|
58
58
|
from polars import DataFrame as PolarsDataFrame
|
|
59
59
|
from sqlalchemy.engine import URL, Engine, Inspector
|
|
60
60
|
|
|
@@ -391,7 +391,7 @@ class DbApiHook(BaseHook):
|
|
|
391
391
|
sql,
|
|
392
392
|
parameters: list | tuple | Mapping[str, Any] | None = None,
|
|
393
393
|
**kwargs,
|
|
394
|
-
) ->
|
|
394
|
+
) -> PandasDataFrame:
|
|
395
395
|
"""
|
|
396
396
|
Execute the sql and returns a pandas dataframe.
|
|
397
397
|
|
|
@@ -399,7 +399,7 @@ class DbApiHook(BaseHook):
|
|
|
399
399
|
:param parameters: The parameters to render the SQL query with.
|
|
400
400
|
:param kwargs: (optional) passed into pandas.io.sql.read_sql method
|
|
401
401
|
"""
|
|
402
|
-
return self.
|
|
402
|
+
return self.get_df(sql, parameters, df_type="pandas", **kwargs)
|
|
403
403
|
|
|
404
404
|
@deprecated(
|
|
405
405
|
reason="Replaced by function `get_df_by_chunks`.",
|
|
@@ -413,17 +413,37 @@ class DbApiHook(BaseHook):
|
|
|
413
413
|
*,
|
|
414
414
|
chunksize: int,
|
|
415
415
|
**kwargs,
|
|
416
|
-
) -> Generator[
|
|
417
|
-
return self.
|
|
416
|
+
) -> Generator[PandasDataFrame, None, None]:
|
|
417
|
+
return self.get_df_by_chunks(sql, parameters, chunksize=chunksize, df_type="pandas", **kwargs)
|
|
418
418
|
|
|
419
|
+
@overload
|
|
419
420
|
def get_df(
|
|
420
421
|
self,
|
|
421
|
-
sql,
|
|
422
|
+
sql: str | list[str],
|
|
423
|
+
parameters: list | tuple | Mapping[str, Any] | None = None,
|
|
424
|
+
*,
|
|
425
|
+
df_type: Literal["pandas"] = "pandas",
|
|
426
|
+
**kwargs: Any,
|
|
427
|
+
) -> PandasDataFrame: ...
|
|
428
|
+
|
|
429
|
+
@overload
|
|
430
|
+
def get_df(
|
|
431
|
+
self,
|
|
432
|
+
sql: str | list[str],
|
|
433
|
+
parameters: list | tuple | Mapping[str, Any] | None = None,
|
|
434
|
+
*,
|
|
435
|
+
df_type: Literal["polars"],
|
|
436
|
+
**kwargs: Any,
|
|
437
|
+
) -> PolarsDataFrame: ...
|
|
438
|
+
|
|
439
|
+
def get_df(
|
|
440
|
+
self,
|
|
441
|
+
sql: str | list[str],
|
|
422
442
|
parameters: list | tuple | Mapping[str, Any] | None = None,
|
|
423
443
|
*,
|
|
424
444
|
df_type: Literal["pandas", "polars"] = "pandas",
|
|
425
445
|
**kwargs,
|
|
426
|
-
) ->
|
|
446
|
+
) -> PandasDataFrame | PolarsDataFrame:
|
|
427
447
|
"""
|
|
428
448
|
Execute the sql and returns a dataframe.
|
|
429
449
|
|
|
@@ -442,7 +462,7 @@ class DbApiHook(BaseHook):
|
|
|
442
462
|
sql,
|
|
443
463
|
parameters: list | tuple | Mapping[str, Any] | None = None,
|
|
444
464
|
**kwargs,
|
|
445
|
-
) ->
|
|
465
|
+
) -> PandasDataFrame:
|
|
446
466
|
"""
|
|
447
467
|
Execute the sql and returns a pandas dataframe.
|
|
448
468
|
|
|
@@ -492,15 +512,37 @@ class DbApiHook(BaseHook):
|
|
|
492
512
|
|
|
493
513
|
return pl.read_database(sql, connection=conn, execute_options=execute_options, **kwargs)
|
|
494
514
|
|
|
515
|
+
@overload
|
|
495
516
|
def get_df_by_chunks(
|
|
496
517
|
self,
|
|
497
|
-
sql,
|
|
518
|
+
sql: str | list[str],
|
|
519
|
+
parameters: list | tuple | Mapping[str, Any] | None = None,
|
|
520
|
+
*,
|
|
521
|
+
chunksize: int,
|
|
522
|
+
df_type: Literal["pandas"] = "pandas",
|
|
523
|
+
**kwargs,
|
|
524
|
+
) -> Generator[PandasDataFrame, None, None]: ...
|
|
525
|
+
|
|
526
|
+
@overload
|
|
527
|
+
def get_df_by_chunks(
|
|
528
|
+
self,
|
|
529
|
+
sql: str | list[str],
|
|
530
|
+
parameters: list | tuple | Mapping[str, Any] | None = None,
|
|
531
|
+
*,
|
|
532
|
+
chunksize: int,
|
|
533
|
+
df_type: Literal["polars"],
|
|
534
|
+
**kwargs,
|
|
535
|
+
) -> Generator[PolarsDataFrame, None, None]: ...
|
|
536
|
+
|
|
537
|
+
def get_df_by_chunks(
|
|
538
|
+
self,
|
|
539
|
+
sql: str | list[str],
|
|
498
540
|
parameters: list | tuple | Mapping[str, Any] | None = None,
|
|
499
541
|
*,
|
|
500
542
|
chunksize: int,
|
|
501
543
|
df_type: Literal["pandas", "polars"] = "pandas",
|
|
502
544
|
**kwargs,
|
|
503
|
-
) -> Generator[
|
|
545
|
+
) -> Generator[PandasDataFrame | PolarsDataFrame, None, None]:
|
|
504
546
|
"""
|
|
505
547
|
Execute the sql and return a generator.
|
|
506
548
|
|
|
@@ -522,7 +564,7 @@ class DbApiHook(BaseHook):
|
|
|
522
564
|
*,
|
|
523
565
|
chunksize: int,
|
|
524
566
|
**kwargs,
|
|
525
|
-
) -> Generator[
|
|
567
|
+
) -> Generator[PandasDataFrame, None, None]:
|
|
526
568
|
"""
|
|
527
569
|
Execute the sql and return a generator.
|
|
528
570
|
|
|
@@ -34,13 +34,11 @@ isort:skip_file
|
|
|
34
34
|
|
|
35
35
|
from collections.abc import Generator, Iterable, Mapping, MutableMapping, Sequence
|
|
36
36
|
from functools import cached_property as cached_property
|
|
37
|
-
from typing import Any,
|
|
37
|
+
from typing import Any, Protocol, TypeVar
|
|
38
38
|
|
|
39
39
|
from _typeshed import Incomplete as Incomplete
|
|
40
40
|
from pandas import DataFrame as PandasDataFrame
|
|
41
|
-
from polars import DataFrame as PolarsDataFrame
|
|
42
41
|
from sqlalchemy.engine import URL as URL, Engine as Engine, Inspector as Inspector
|
|
43
|
-
from typing_extensions import Literal
|
|
44
42
|
|
|
45
43
|
from airflow.hooks.base import BaseHook as BaseHook
|
|
46
44
|
from airflow.models import Connection as Connection
|
|
@@ -111,61 +109,6 @@ class DbApiHook(BaseHook):
|
|
|
111
109
|
def get_pandas_df_by_chunks(
|
|
112
110
|
self, sql, parameters: list | tuple | Mapping[str, Any] | None = None, *, chunksize: int, **kwargs
|
|
113
111
|
) -> Generator[PandasDataFrame, None, None]: ...
|
|
114
|
-
@overload
|
|
115
|
-
def get_df(
|
|
116
|
-
self,
|
|
117
|
-
sql: str | list[str],
|
|
118
|
-
parameters: list | tuple | Mapping[str, Any] | None = None,
|
|
119
|
-
*,
|
|
120
|
-
df_type: Literal["pandas"] = "pandas",
|
|
121
|
-
**kwargs: Any,
|
|
122
|
-
) -> PandasDataFrame: ...
|
|
123
|
-
@overload
|
|
124
|
-
def get_df(
|
|
125
|
-
self,
|
|
126
|
-
sql: str | list[str],
|
|
127
|
-
parameters: list | tuple | Mapping[str, Any] | None = None,
|
|
128
|
-
*,
|
|
129
|
-
df_type: Literal["polars"] = "polars",
|
|
130
|
-
**kwargs: Any,
|
|
131
|
-
) -> PolarsDataFrame: ...
|
|
132
|
-
@overload
|
|
133
|
-
def get_df( # fallback overload
|
|
134
|
-
self,
|
|
135
|
-
sql: str | list[str],
|
|
136
|
-
parameters: list | tuple | Mapping[str, Any] | None = None,
|
|
137
|
-
*,
|
|
138
|
-
df_type: Literal["pandas", "polars"] = "pandas",
|
|
139
|
-
) -> PandasDataFrame | PolarsDataFrame: ...
|
|
140
|
-
@overload
|
|
141
|
-
def get_df_by_chunks(
|
|
142
|
-
self,
|
|
143
|
-
sql,
|
|
144
|
-
parameters: list | tuple | Mapping[str, Any] | None = None,
|
|
145
|
-
*,
|
|
146
|
-
chunksize: int,
|
|
147
|
-
df_type: Literal["pandas"] = "pandas",
|
|
148
|
-
**kwargs,
|
|
149
|
-
) -> Generator[PandasDataFrame, None, None]: ...
|
|
150
|
-
@overload
|
|
151
|
-
def get_df_by_chunks(
|
|
152
|
-
self,
|
|
153
|
-
sql,
|
|
154
|
-
parameters: list | tuple | Mapping[str, Any] | None = None,
|
|
155
|
-
*,
|
|
156
|
-
chunksize: int,
|
|
157
|
-
df_type: Literal["polars"],
|
|
158
|
-
**kwargs,
|
|
159
|
-
) -> Generator[PolarsDataFrame, None, None]: ...
|
|
160
|
-
@overload
|
|
161
|
-
def get_df_by_chunks( # fallback overload
|
|
162
|
-
self,
|
|
163
|
-
sql,
|
|
164
|
-
parameters: list | tuple | Mapping[str, Any] | None = None,
|
|
165
|
-
*,
|
|
166
|
-
chunksize: int,
|
|
167
|
-
df_type: Literal["pandas", "polars"] = "pandas",
|
|
168
|
-
) -> Generator[PandasDataFrame | PolarsDataFrame, None, None]: ...
|
|
169
112
|
def get_records(
|
|
170
113
|
self, sql: str | list[str], parameters: Iterable | Mapping[str, Any] | None = None
|
|
171
114
|
) -> Any: ...
|
|
@@ -178,26 +121,6 @@ class DbApiHook(BaseHook):
|
|
|
178
121
|
def split_sql_string(sql: str, strip_semicolon: bool = False) -> list[str]: ...
|
|
179
122
|
@property
|
|
180
123
|
def last_description(self) -> Sequence[Sequence] | None: ...
|
|
181
|
-
@overload
|
|
182
|
-
def run(
|
|
183
|
-
self,
|
|
184
|
-
sql: str | Iterable[str],
|
|
185
|
-
autocommit: bool = ...,
|
|
186
|
-
parameters: Iterable | Mapping[str, Any] | None = ...,
|
|
187
|
-
handler: None = ...,
|
|
188
|
-
split_statements: bool = ...,
|
|
189
|
-
return_last: bool = ...,
|
|
190
|
-
) -> None: ...
|
|
191
|
-
@overload
|
|
192
|
-
def run(
|
|
193
|
-
self,
|
|
194
|
-
sql: str | Iterable[str],
|
|
195
|
-
autocommit: bool = ...,
|
|
196
|
-
parameters: Iterable | Mapping[str, Any] | None = ...,
|
|
197
|
-
handler: Callable[[Any], T] = ...,
|
|
198
|
-
split_statements: bool = ...,
|
|
199
|
-
return_last: bool = ...,
|
|
200
|
-
) -> tuple | list[tuple] | list[list[tuple] | tuple] | None: ...
|
|
201
124
|
def set_autocommit(self, conn, autocommit) -> None: ...
|
|
202
125
|
def get_autocommit(self, conn) -> bool: ...
|
|
203
126
|
def get_cursor(self) -> Any: ...
|
|
@@ -23,6 +23,8 @@ import logging
|
|
|
23
23
|
import logging.config
|
|
24
24
|
from unittest.mock import MagicMock
|
|
25
25
|
|
|
26
|
+
import pandas as pd
|
|
27
|
+
import polars as pl
|
|
26
28
|
import pytest
|
|
27
29
|
|
|
28
30
|
from airflow.config_templates.airflow_local_settings import DEFAULT_LOGGING_CONFIG
|
|
@@ -306,3 +308,21 @@ class TestDbApiHook:
|
|
|
306
308
|
def test_uri_with_schema(self):
|
|
307
309
|
dbapi_hook = mock_db_hook(DbApiHook, conn_params={"schema": "other_schema"})
|
|
308
310
|
assert dbapi_hook.get_uri() == "//login:password@host:1234/other_schema"
|
|
311
|
+
|
|
312
|
+
@pytest.mark.db_test
|
|
313
|
+
@pytest.mark.parametrize(
|
|
314
|
+
"df_type, expected_type",
|
|
315
|
+
[
|
|
316
|
+
("test_default_df_type", pd.DataFrame),
|
|
317
|
+
("pandas", pd.DataFrame),
|
|
318
|
+
("polars", pl.DataFrame),
|
|
319
|
+
],
|
|
320
|
+
)
|
|
321
|
+
def test_get_df_with_df_type(db, df_type, expected_type):
|
|
322
|
+
dbapi_hook = mock_db_hook(DbApiHook)
|
|
323
|
+
if df_type == "test_default_df_type":
|
|
324
|
+
df = dbapi_hook.get_df("SQL")
|
|
325
|
+
assert isinstance(df, pd.DataFrame)
|
|
326
|
+
else:
|
|
327
|
+
df = dbapi_hook.get_df("SQL", df_type=df_type)
|
|
328
|
+
assert isinstance(df, expected_type)
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|