apache-airflow-providers-postgres 6.2.0__py3-none-any.whl → 6.2.1__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.
- airflow/providers/postgres/__init__.py +1 -1
- airflow/providers/postgres/hooks/postgres.py +12 -6
- {apache_airflow_providers_postgres-6.2.0.dist-info → apache_airflow_providers_postgres-6.2.1.dist-info}/METADATA +8 -9
- {apache_airflow_providers_postgres-6.2.0.dist-info → apache_airflow_providers_postgres-6.2.1.dist-info}/RECORD +6 -6
- {apache_airflow_providers_postgres-6.2.0.dist-info → apache_airflow_providers_postgres-6.2.1.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_postgres-6.2.0.dist-info → apache_airflow_providers_postgres-6.2.1.dist-info}/entry_points.txt +0 -0
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
|
|
29
29
|
|
30
30
|
__all__ = ["__version__"]
|
31
31
|
|
32
|
-
__version__ = "6.2.
|
32
|
+
__version__ = "6.2.1"
|
33
33
|
|
34
34
|
if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
|
35
35
|
"2.10.0"
|
@@ -20,7 +20,7 @@ from __future__ import annotations
|
|
20
20
|
import os
|
21
21
|
from contextlib import closing
|
22
22
|
from copy import deepcopy
|
23
|
-
from typing import TYPE_CHECKING, Any,
|
23
|
+
from typing import TYPE_CHECKING, Any, TypeAlias, cast
|
24
24
|
|
25
25
|
import psycopg2
|
26
26
|
import psycopg2.extensions
|
@@ -35,11 +35,15 @@ from airflow.providers.postgres.dialects.postgres import PostgresDialect
|
|
35
35
|
if TYPE_CHECKING:
|
36
36
|
from psycopg2.extensions import connection
|
37
37
|
|
38
|
-
from airflow.models.connection import Connection
|
39
38
|
from airflow.providers.common.sql.dialects.dialect import Dialect
|
40
39
|
from airflow.providers.openlineage.sqlparser import DatabaseInfo
|
41
40
|
|
42
|
-
|
41
|
+
try:
|
42
|
+
from airflow.sdk import Connection
|
43
|
+
except ImportError:
|
44
|
+
from airflow.models.connection import Connection # type: ignore[assignment]
|
45
|
+
|
46
|
+
CursorType: TypeAlias = DictCursor | RealDictCursor | NamedTupleCursor
|
43
47
|
|
44
48
|
|
45
49
|
class PostgresHook(DbApiHook):
|
@@ -256,7 +260,9 @@ class PostgresHook(DbApiHook):
|
|
256
260
|
port = conn.port or 5439
|
257
261
|
# Pull the custer-identifier from the beginning of the Redshift URL
|
258
262
|
# ex. my-cluster.ccdre4hpd39h.us-east-1.redshift.amazonaws.com returns my-cluster
|
259
|
-
cluster_identifier = conn.extra_dejson.get(
|
263
|
+
cluster_identifier = conn.extra_dejson.get(
|
264
|
+
"cluster-identifier", cast("str", conn.host).split(".")[0]
|
265
|
+
)
|
260
266
|
redshift_client = AwsBaseHook(aws_conn_id=aws_conn_id, client_type="redshift").conn
|
261
267
|
# https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/redshift/client/get_cluster_credentials.html#Redshift.Client.get_cluster_credentials
|
262
268
|
cluster_creds = redshift_client.get_cluster_credentials(
|
@@ -272,7 +278,7 @@ class PostgresHook(DbApiHook):
|
|
272
278
|
# Pull the workgroup-name from the query params/extras, if not there then pull it from the
|
273
279
|
# beginning of the Redshift URL
|
274
280
|
# ex. workgroup-name.ccdre4hpd39h.us-east-1.redshift.amazonaws.com returns workgroup-name
|
275
|
-
workgroup_name = conn.extra_dejson.get("workgroup-name", conn.host.split(".")[0])
|
281
|
+
workgroup_name = conn.extra_dejson.get("workgroup-name", cast("str", conn.host).split(".")[0])
|
276
282
|
redshift_serverless_client = AwsBaseHook(
|
277
283
|
aws_conn_id=aws_conn_id, client_type="redshift-serverless"
|
278
284
|
).conn
|
@@ -288,7 +294,7 @@ class PostgresHook(DbApiHook):
|
|
288
294
|
rds_client = AwsBaseHook(aws_conn_id=aws_conn_id, client_type="rds").conn
|
289
295
|
# https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds/client/generate_db_auth_token.html#RDS.Client.generate_db_auth_token
|
290
296
|
token = rds_client.generate_db_auth_token(conn.host, port, conn.login)
|
291
|
-
return login, token, port
|
297
|
+
return cast("str", login), cast("str", token), port
|
292
298
|
|
293
299
|
def get_table_primary_key(self, table: str, schema: str | None = "public") -> list[str] | None:
|
294
300
|
"""
|
@@ -1,11 +1,11 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: apache-airflow-providers-postgres
|
3
|
-
Version: 6.2.
|
3
|
+
Version: 6.2.1
|
4
4
|
Summary: Provider package apache-airflow-providers-postgres for Apache Airflow
|
5
5
|
Keywords: airflow-provider,postgres,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: ~=3.
|
8
|
+
Requires-Python: ~=3.10
|
9
9
|
Description-Content-Type: text/x-rst
|
10
10
|
Classifier: Development Status :: 5 - Production/Stable
|
11
11
|
Classifier: Environment :: Console
|
@@ -15,7 +15,6 @@ Classifier: Intended Audience :: System Administrators
|
|
15
15
|
Classifier: Framework :: Apache Airflow
|
16
16
|
Classifier: Framework :: Apache Airflow :: Provider
|
17
17
|
Classifier: License :: OSI Approved :: Apache Software License
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
19
18
|
Classifier: Programming Language :: Python :: 3.10
|
20
19
|
Classifier: Programming Language :: Python :: 3.11
|
21
20
|
Classifier: Programming Language :: Python :: 3.12
|
@@ -27,8 +26,8 @@ Requires-Dist: asyncpg>=0.30.0
|
|
27
26
|
Requires-Dist: apache-airflow-providers-amazon>=2.6.0 ; extra == "amazon"
|
28
27
|
Requires-Dist: apache-airflow-providers-openlineage ; extra == "openlineage"
|
29
28
|
Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
|
30
|
-
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-postgres/6.2.
|
31
|
-
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-postgres/6.2.
|
29
|
+
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-postgres/6.2.1/changelog.html
|
30
|
+
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-postgres/6.2.1
|
32
31
|
Project-URL: Mastodon, https://fosstodon.org/@airflow
|
33
32
|
Project-URL: Slack Chat, https://s.apache.org/airflow-slack
|
34
33
|
Project-URL: Source Code, https://github.com/apache/airflow
|
@@ -61,7 +60,7 @@ Provides-Extra: openlineage
|
|
61
60
|
|
62
61
|
Package ``apache-airflow-providers-postgres``
|
63
62
|
|
64
|
-
Release: ``6.2.
|
63
|
+
Release: ``6.2.1``
|
65
64
|
|
66
65
|
|
67
66
|
`PostgreSQL <https://www.postgresql.org/>`__
|
@@ -74,7 +73,7 @@ This is a provider package for ``postgres`` provider. All classes for this provi
|
|
74
73
|
are in ``airflow.providers.postgres`` python package.
|
75
74
|
|
76
75
|
You can find package information and changelog for the provider
|
77
|
-
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-postgres/6.2.
|
76
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-postgres/6.2.1/>`_.
|
78
77
|
|
79
78
|
Installation
|
80
79
|
------------
|
@@ -83,7 +82,7 @@ You can install this package on top of an existing Airflow 2 installation (see `
|
|
83
82
|
for the minimum Airflow version supported) via
|
84
83
|
``pip install apache-airflow-providers-postgres``
|
85
84
|
|
86
|
-
The package supports the following python versions: 3.
|
85
|
+
The package supports the following python versions: 3.10,3.11,3.12
|
87
86
|
|
88
87
|
Requirements
|
89
88
|
------------
|
@@ -119,5 +118,5 @@ Dependent package
|
|
119
118
|
============================================================================================================== ===============
|
120
119
|
|
121
120
|
The changelog for the provider package can be found in the
|
122
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-postgres/6.2.
|
121
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-postgres/6.2.1/changelog.html>`_.
|
123
122
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
airflow/providers/postgres/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
|
2
|
-
airflow/providers/postgres/__init__.py,sha256=
|
2
|
+
airflow/providers/postgres/__init__.py,sha256=xcSFcWJsS6ZqYJ6-TEbr1G4meLj96HKjJ4GHL_pAH8s,1497
|
3
3
|
airflow/providers/postgres/get_provider_info.py,sha256=qEEYbClLY3-NH40dBk2u_nOIfvfEIHdXaWsIJ8J5Z68,2626
|
4
4
|
airflow/providers/postgres/assets/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
5
5
|
airflow/providers/postgres/assets/postgres.py,sha256=XNhOJCbOA_soaaiS73JjULMqAM_7PBryhToe8FJREA0,1522
|
6
6
|
airflow/providers/postgres/dialects/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
7
7
|
airflow/providers/postgres/dialects/postgres.py,sha256=8ygA2Jq2WBPhNOISU8YyitLmahxWnPGYNt8OaU_CBFI,3764
|
8
8
|
airflow/providers/postgres/hooks/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
9
|
-
airflow/providers/postgres/hooks/postgres.py,sha256=
|
10
|
-
apache_airflow_providers_postgres-6.2.
|
11
|
-
apache_airflow_providers_postgres-6.2.
|
12
|
-
apache_airflow_providers_postgres-6.2.
|
13
|
-
apache_airflow_providers_postgres-6.2.
|
9
|
+
airflow/providers/postgres/hooks/postgres.py,sha256=RsESjnGfYKgtlNlqrUdKCKXop-D0Rj2IXcFlvF66oHM,15611
|
10
|
+
apache_airflow_providers_postgres-6.2.1.dist-info/entry_points.txt,sha256=dhtJi6PTWHd6BwKhmI4OtSPvQVI_p0yYWI0eba83HqY,104
|
11
|
+
apache_airflow_providers_postgres-6.2.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
12
|
+
apache_airflow_providers_postgres-6.2.1.dist-info/METADATA,sha256=STb2qBSo5GVfNtE4keJZestUHzlMTeN1kQAIYvbfdug,5636
|
13
|
+
apache_airflow_providers_postgres-6.2.1.dist-info/RECORD,,
|
File without changes
|