apache-airflow-providers-postgres 5.5.0rc1__py3-none-any.whl → 5.5.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.
@@ -26,13 +26,16 @@ from __future__ import annotations
26
26
 
27
27
  import packaging.version
28
28
 
29
- import airflow
29
+ __all__ = ["__version__"]
30
30
 
31
- __all__ = ["version"]
31
+ __version__ = "5.5.1"
32
32
 
33
- version = "5.5.0"
33
+ try:
34
+ from airflow import __version__ as airflow_version
35
+ except ImportError:
36
+ from airflow.version import version as airflow_version
34
37
 
35
- if packaging.version.parse(airflow.version.version) < packaging.version.parse("2.4.0"):
38
+ if packaging.version.parse(airflow_version) < packaging.version.parse("2.4.0"):
36
39
  raise RuntimeError(
37
- f"The package `apache-airflow-providers-postgres:{version}` requires Apache Airflow 2.4.0+"
40
+ f"The package `apache-airflow-providers-postgres:{__version__}` requires Apache Airflow 2.4.0+" # NOQA: E501
38
41
  )
@@ -29,6 +29,7 @@ def get_provider_info():
29
29
  "description": "`PostgreSQL <https://www.postgresql.org/>`__\n",
30
30
  "suspended": False,
31
31
  "versions": [
32
+ "5.5.1",
32
33
  "5.5.0",
33
34
  "5.4.0",
34
35
  "5.3.1",
@@ -37,8 +37,7 @@ CursorType = Union[DictCursor, RealDictCursor, NamedTupleCursor]
37
37
 
38
38
 
39
39
  class PostgresHook(DbApiHook):
40
- """
41
- Interact with Postgres.
40
+ """Interact with Postgres.
42
41
 
43
42
  You can specify ssl parameters in the extra field of your connection
44
43
  as ``{"sslmode": "require", "sslcert": "/path/to/cert.pem", etc}``.
@@ -146,8 +145,8 @@ class PostgresHook(DbApiHook):
146
145
  return self.conn
147
146
 
148
147
  def copy_expert(self, sql: str, filename: str) -> None:
149
- """
150
- Executes SQL using psycopg2 copy_expert method.
148
+ """Executes SQL using psycopg2's ``copy_expert`` method.
149
+
151
150
  Necessary to execute COPY command without access to a superuser.
152
151
 
153
152
  Note: if this method is called with a "COPY FROM" statement and
@@ -169,8 +168,8 @@ class PostgresHook(DbApiHook):
169
168
  conn.commit()
170
169
 
171
170
  def get_uri(self) -> str:
172
- """
173
- Extract the URI from the connection.
171
+ """Extract the URI from the connection.
172
+
174
173
  :return: the extracted uri.
175
174
  """
176
175
  conn = self.get_connection(getattr(self, self.conn_name_attr))
@@ -179,18 +178,19 @@ class PostgresHook(DbApiHook):
179
178
  return uri
180
179
 
181
180
  def bulk_load(self, table: str, tmp_file: str) -> None:
182
- """Loads a tab-delimited file into a database table"""
181
+ """Loads a tab-delimited file into a database table."""
183
182
  self.copy_expert(f"COPY {table} FROM STDIN", tmp_file)
184
183
 
185
184
  def bulk_dump(self, table: str, tmp_file: str) -> None:
186
- """Dumps a database table into a tab-delimited file"""
185
+ """Dumps a database table into a tab-delimited file."""
187
186
  self.copy_expert(f"COPY {table} TO STDOUT", tmp_file)
188
187
 
189
188
  @staticmethod
190
189
  def _serialize_cell(cell: object, conn: connection | None = None) -> Any:
191
- """
192
- Postgresql will adapt all arguments to the execute() method internally,
193
- hence we return cell without any conversion.
190
+ """Serialize a cell.
191
+
192
+ PostgreSQL adapts all arguments to the ``execute()`` method internally,
193
+ hence we return the cell without any conversion.
194
194
 
195
195
  See http://initd.org/psycopg/docs/advanced.html#adapting-new-types for
196
196
  more information.
@@ -202,10 +202,11 @@ class PostgresHook(DbApiHook):
202
202
  return cell
203
203
 
204
204
  def get_iam_token(self, conn: Connection) -> tuple[str, str, int]:
205
- """
206
- Uses AWSHook to retrieve a temporary password to connect to Postgres
207
- or Redshift. Port is required. If none is provided, default is used for
208
- each service
205
+ """Get the IAM token.
206
+
207
+ This uses AWSHook to retrieve a temporary password to connect to
208
+ Postgres or Redshift. Port is required. If none is provided, the default
209
+ 5432 is used.
209
210
  """
210
211
  try:
211
212
  from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
@@ -242,8 +243,7 @@ class PostgresHook(DbApiHook):
242
243
  return login, token, port
243
244
 
244
245
  def get_table_primary_key(self, table: str, schema: str | None = "public") -> list[str] | None:
245
- """
246
- Helper method that returns the table primary key
246
+ """Get the table's primary key.
247
247
 
248
248
  :param table: Name of the target table
249
249
  :param schema: Name of the target schema, public by default
@@ -267,9 +267,9 @@ class PostgresHook(DbApiHook):
267
267
  def _generate_insert_sql(
268
268
  cls, table: str, values: tuple[str, ...], target_fields: Iterable[str], replace: bool, **kwargs
269
269
  ) -> str:
270
- """
271
- Static helper method that generates the INSERT SQL statement.
272
- The REPLACE variant is specific to PostgreSQL syntax.
270
+ """Generate the INSERT SQL statement.
271
+
272
+ The REPLACE variant is specific to the PostgreSQL syntax.
273
273
 
274
274
  :param table: Name of the target table
275
275
  :param values: The row to insert into the table
@@ -28,7 +28,7 @@ from airflow.providers.common.sql.operators.sql import SQLExecuteQueryOperator
28
28
 
29
29
  class PostgresOperator(SQLExecuteQueryOperator):
30
30
  """
31
- Executes sql code in a specific Postgres database
31
+ Executes sql code in a specific Postgres database.
32
32
 
33
33
  :param sql: the SQL code to be executed as a single string, or
34
34
  a list of str (sql statements), or a reference to a template file.
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apache-airflow-providers-postgres
3
- Version: 5.5.0rc1
3
+ Version: 5.5.1
4
4
  Summary: Provider for Apache Airflow. Implements apache-airflow-providers-postgres package
5
5
  Home-page: https://airflow.apache.org/
6
6
  Download-URL: https://archive.apache.org/dist/airflow/providers
7
7
  Author: Apache Software Foundation
8
8
  Author-email: dev@airflow.apache.org
9
9
  License: Apache License 2.0
10
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-postgres/5.5.0/
10
+ Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-postgres/5.5.1/
11
11
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
12
12
  Project-URL: Source Code, https://github.com/apache/airflow
13
13
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
@@ -21,17 +21,17 @@ Classifier: Intended Audience :: System Administrators
21
21
  Classifier: Framework :: Apache Airflow
22
22
  Classifier: Framework :: Apache Airflow :: Provider
23
23
  Classifier: License :: OSI Approved :: Apache Software License
24
- Classifier: Programming Language :: Python :: 3.7
25
24
  Classifier: Programming Language :: Python :: 3.8
26
25
  Classifier: Programming Language :: Python :: 3.9
27
26
  Classifier: Programming Language :: Python :: 3.10
27
+ Classifier: Programming Language :: Python :: 3.11
28
28
  Classifier: Topic :: System :: Monitoring
29
- Requires-Python: ~=3.7
29
+ Requires-Python: ~=3.8
30
30
  Description-Content-Type: text/x-rst
31
31
  License-File: LICENSE
32
32
  License-File: NOTICE
33
- Requires-Dist: apache-airflow-providers-common-sql (>=1.3.1.dev0)
34
- Requires-Dist: apache-airflow (>=2.4.0.dev0)
33
+ Requires-Dist: apache-airflow-providers-common-sql (>=1.3.1)
34
+ Requires-Dist: apache-airflow (>=2.4.0)
35
35
  Requires-Dist: psycopg2-binary (>=2.8.0)
36
36
  Provides-Extra: amazon
37
37
  Requires-Dist: apache-airflow-providers-amazon (>=2.6.0) ; extra == 'amazon'
@@ -59,7 +59,7 @@ Requires-Dist: apache-airflow-providers-common-sql ; extra == 'common.sql'
59
59
 
60
60
  Package ``apache-airflow-providers-postgres``
61
61
 
62
- Release: ``5.5.0rc1``
62
+ Release: ``5.5.1``
63
63
 
64
64
 
65
65
  `PostgreSQL <https://www.postgresql.org/>`__
@@ -72,7 +72,7 @@ This is a provider package for ``postgres`` provider. All classes for this provi
72
72
  are in ``airflow.providers.postgres`` python package.
73
73
 
74
74
  You can find package information and changelog for the provider
75
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-postgres/5.5.0/>`_.
75
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-postgres/5.5.1/>`_.
76
76
 
77
77
 
78
78
  Installation
@@ -82,7 +82,7 @@ You can install this package on top of an existing Airflow 2 installation (see `
82
82
  for the minimum Airflow version supported) via
83
83
  ``pip install apache-airflow-providers-postgres``
84
84
 
85
- The package supports the following python versions: 3.7,3.8,3.9,3.10
85
+ The package supports the following python versions: 3.8,3.9,3.10,3.11
86
86
 
87
87
  Requirements
88
88
  ------------
@@ -141,6 +141,22 @@ Dependent package
141
141
  Changelog
142
142
  ---------
143
143
 
144
+ 5.5.1
145
+ .....
146
+
147
+ .. note::
148
+ This release dropped support for Python 3.7
149
+
150
+ Misc
151
+ ~~~~
152
+
153
+ * ``Add note about dropping Python 3.7 for providers (#32015)``
154
+
155
+ .. Below changes are excluded from the changelog. Move them to
156
+ appropriate section above if needed. Do not delete the lines(!):
157
+ * ``Improve docstrings in providers (#31681)``
158
+ * ``Add D400 pydocstyle check - Providers (#31427)``
159
+
144
160
  5.5.0
145
161
  .....
146
162
 
@@ -158,6 +174,9 @@ Misc
158
174
  * ``Add full automation for min Airflow version for providers (#30994)``
159
175
  * ``Add mechanism to suspend providers (#30422)``
160
176
  * ``Use 'AirflowProviderDeprecationWarning' in providers (#30975)``
177
+ * ``Use '__version__' in providers not 'version' (#31393)``
178
+ * ``Fixing circular import error in providers caused by airflow version check (#31379)``
179
+ * ``Prepare docs for May 2023 wave of Providers (#31252)``
161
180
 
162
181
  5.4.0
163
182
  .....
@@ -0,0 +1,13 @@
1
+ airflow/providers/postgres/__init__.py,sha256=XRmQ8xK1PPPOeGTneJ7mYHMZarp-6OmqeU0Sgg1-0Wk,1533
2
+ airflow/providers/postgres/get_provider_info.py,sha256=Uz69xsIlWyL8mMPWRylc24JazKD4gdONoJuZNZC0f5M,3077
3
+ airflow/providers/postgres/hooks/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
4
+ airflow/providers/postgres/hooks/postgres.py,sha256=gnddPtsdsCy3st8TBzOiES9myclt03JUWWdSA0JPAKc,12967
5
+ airflow/providers/postgres/operators/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
6
+ airflow/providers/postgres/operators/postgres.py,sha256=9zvEaDPDfGogOXHEn1R9rCzlOz8ZUnTvKFWeuJjuRnE,3735
7
+ apache_airflow_providers_postgres-5.5.1.dist-info/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
8
+ apache_airflow_providers_postgres-5.5.1.dist-info/METADATA,sha256=kEtd8BGZaOvIs6zV1UteGm-SUhfnIFlAmZwzDzCtvR8,15854
9
+ apache_airflow_providers_postgres-5.5.1.dist-info/NOTICE,sha256=m-6s2XynUxVSUIxO4rVablAZCvFq-wmLrqV91DotRBw,240
10
+ apache_airflow_providers_postgres-5.5.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
11
+ apache_airflow_providers_postgres-5.5.1.dist-info/entry_points.txt,sha256=boiuBo37TJDstSn7YjGsk80nn8EOyQ_s3sVJmIJ8Sp8,105
12
+ apache_airflow_providers_postgres-5.5.1.dist-info/top_level.txt,sha256=OeMVH5md7fr2QQWpnZoOWWxWO-0WH1IP70lpTVwopPg,8
13
+ apache_airflow_providers_postgres-5.5.1.dist-info/RECORD,,
@@ -1,13 +0,0 @@
1
- airflow/providers/postgres/__init__.py,sha256=x9jP5ZwibGIoPraMTAhi8GpBCpjBMuxZBpECx90sYLs,1391
2
- airflow/providers/postgres/get_provider_info.py,sha256=rDiZ3pcvsGgYBKRJdns4GKKxik551f6gp2I4jnjqNUs,3056
3
- airflow/providers/postgres/hooks/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
4
- airflow/providers/postgres/hooks/postgres.py,sha256=UCv0gs6_JLtNMvlsT9tPHU_lXo6VYf990KTaljcDkmw,13001
5
- airflow/providers/postgres/operators/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
6
- airflow/providers/postgres/operators/postgres.py,sha256=8SNeD1itVTtIgTVdHvw7gH3frU2mqP2RSptoORe00Yg,3734
7
- apache_airflow_providers_postgres-5.5.0rc1.dist-info/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
8
- apache_airflow_providers_postgres-5.5.0rc1.dist-info/METADATA,sha256=BJmkECROcw5VzzdNy1aKhP-7QTGiyjUqn7f4ZA_XrvM,15267
9
- apache_airflow_providers_postgres-5.5.0rc1.dist-info/NOTICE,sha256=m-6s2XynUxVSUIxO4rVablAZCvFq-wmLrqV91DotRBw,240
10
- apache_airflow_providers_postgres-5.5.0rc1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
11
- apache_airflow_providers_postgres-5.5.0rc1.dist-info/entry_points.txt,sha256=boiuBo37TJDstSn7YjGsk80nn8EOyQ_s3sVJmIJ8Sp8,105
12
- apache_airflow_providers_postgres-5.5.0rc1.dist-info/top_level.txt,sha256=OeMVH5md7fr2QQWpnZoOWWxWO-0WH1IP70lpTVwopPg,8
13
- apache_airflow_providers_postgres-5.5.0rc1.dist-info/RECORD,,