apache-airflow-providers-amazon 9.1.0rc1__py3-none-any.whl → 9.1.0rc2__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.
@@ -17,6 +17,7 @@
17
17
  from __future__ import annotations
18
18
 
19
19
  import argparse
20
+ import warnings
20
21
  from collections import defaultdict
21
22
  from functools import cached_property
22
23
  from typing import TYPE_CHECKING, Container, Sequence, cast
@@ -24,7 +25,7 @@ from typing import TYPE_CHECKING, Container, Sequence, cast
24
25
  from flask import session, url_for
25
26
 
26
27
  from airflow.cli.cli_config import CLICommand, DefaultHelpParser, GroupCommand
27
- from airflow.exceptions import AirflowOptionalProviderFeatureException
28
+ from airflow.exceptions import AirflowOptionalProviderFeatureException, AirflowProviderDeprecationWarning
28
29
  from airflow.providers.amazon.aws.auth_manager.avp.entities import AvpEntities
29
30
  from airflow.providers.amazon.aws.auth_manager.avp.facade import (
30
31
  AwsAuthManagerAmazonVerifiedPermissionsFacade,
@@ -166,6 +167,16 @@ class AwsAuthManager(BaseAuthManager):
166
167
  method=method, entity_type=AvpEntities.ASSET, user=user or self.get_user(), entity_id=asset_uri
167
168
  )
168
169
 
170
+ def is_authorized_dataset(
171
+ self, *, method: ResourceMethod, details: AssetDetails | None = None, user: BaseUser | None = None
172
+ ) -> bool:
173
+ warnings.warn(
174
+ "is_authorized_dataset will be renamed as is_authorized_asset in Airflow 3 and will be removed when the minimum Airflow version is set to 3.0 for the amazon provider",
175
+ AirflowProviderDeprecationWarning,
176
+ stacklevel=2,
177
+ )
178
+ return self.is_authorized_asset(method=method, user=user)
179
+
169
180
  def is_authorized_pool(
170
181
  self, *, method: ResourceMethod, details: PoolDetails | None = None, user: BaseUser | None = None
171
182
  ) -> bool:
@@ -117,9 +117,9 @@ class AppflowHook(AwsGenericHook["AppflowClient"]):
117
117
 
118
118
  self.conn.update_flow(
119
119
  flowName=response["flowName"],
120
- destinationFlowConfigList=response["destinationFlowConfigList"], # type: ignore[arg-type]
121
- sourceFlowConfig=response["sourceFlowConfig"], # type: ignore[arg-type]
122
- triggerConfig=response["triggerConfig"], # type: ignore[arg-type]
120
+ destinationFlowConfigList=response["destinationFlowConfigList"],
121
+ sourceFlowConfig=response["sourceFlowConfig"],
122
+ triggerConfig=response["triggerConfig"],
123
123
  description=response.get("description", "Flow description."),
124
- tasks=tasks, # type: ignore[arg-type]
124
+ tasks=tasks,
125
125
  )
@@ -155,14 +155,15 @@ class AthenaHook(AwsBaseHook):
155
155
  state = None
156
156
  try:
157
157
  state = response["QueryExecution"]["Status"]["State"]
158
- except Exception:
159
- self.log.exception(
160
- "Exception while getting query state. Query execution id: %s", query_execution_id
161
- )
162
- finally:
158
+ except Exception as e:
163
159
  # The error is being absorbed here and is being handled by the caller.
164
160
  # The error is being absorbed to implement retries.
165
- return state
161
+ self.log.exception(
162
+ "Exception while getting query state. Query execution id: %s, Exception: %s",
163
+ query_execution_id,
164
+ e,
165
+ )
166
+ return state
166
167
 
167
168
  def get_state_change_reason(self, query_execution_id: str, use_cache: bool = False) -> str | None:
168
169
  """
@@ -177,15 +178,15 @@ class AthenaHook(AwsBaseHook):
177
178
  reason = None
178
179
  try:
179
180
  reason = response["QueryExecution"]["Status"]["StateChangeReason"]
180
- except Exception:
181
+ except Exception as e:
182
+ # The error is being absorbed here and is being handled by the caller.
183
+ # The error is being absorbed to implement retries.
181
184
  self.log.exception(
182
- "Exception while getting query state change reason. Query execution id: %s",
185
+ "Exception while getting query state change reason. Query execution id: %s, Exception: %s",
183
186
  query_execution_id,
187
+ e,
184
188
  )
185
- finally:
186
- # The error is being absorbed here and is being handled by the caller.
187
- # The error is being absorbed to implement retries.
188
- return reason
189
+ return reason
189
190
 
190
191
  def get_query_results(
191
192
  self, query_execution_id: str, next_token_id: str | None = None, max_results: int = 1000
@@ -287,9 +288,18 @@ class AthenaHook(AwsBaseHook):
287
288
  )
288
289
  except AirflowException as error:
289
290
  # this function does not raise errors to keep previous behavior.
290
- self.log.warning(error)
291
- finally:
292
- return self.check_query_status(query_execution_id)
291
+ self.log.warning(
292
+ "AirflowException while polling query status. Query execution id: %s, Exception: %s",
293
+ query_execution_id,
294
+ error,
295
+ )
296
+ except Exception as e:
297
+ self.log.warning(
298
+ "Unexpected exception while polling query status. Query execution id: %s, Exception: %s",
299
+ query_execution_id,
300
+ e,
301
+ )
302
+ return self.check_query_status(query_execution_id)
293
303
 
294
304
  def get_output_location(self, query_execution_id: str) -> str:
295
305
  """
@@ -17,7 +17,7 @@
17
17
  from __future__ import annotations
18
18
 
19
19
  from functools import cached_property
20
- from typing import TYPE_CHECKING, Any, Sequence
20
+ from typing import TYPE_CHECKING, Any, ClassVar, Sequence
21
21
 
22
22
  from airflow.configuration import conf
23
23
  from airflow.exceptions import AirflowException
@@ -55,7 +55,7 @@ class ComprehendBaseOperator(AwsBaseOperator[ComprehendHook]):
55
55
  "input_data_config", "output_data_config", "data_access_role_arn", "language_code"
56
56
  )
57
57
 
58
- template_fields_renderers: dict = {"input_data_config": "json", "output_data_config": "json"}
58
+ template_fields_renderers: ClassVar[dict] = {"input_data_config": "json", "output_data_config": "json"}
59
59
 
60
60
  def __init__(
61
61
  self,
@@ -248,7 +248,7 @@ class ComprehendCreateDocumentClassifierOperator(AwsBaseOperator[ComprehendHook]
248
248
  "document_classifier_kwargs",
249
249
  )
250
250
 
251
- template_fields_renderers: dict = {
251
+ template_fields_renderers: ClassVar[dict] = {
252
252
  "input_data_config": "json",
253
253
  "output_data_config": "json",
254
254
  "document_classifier_kwargs": "json",
@@ -17,7 +17,7 @@
17
17
  # under the License.
18
18
  from __future__ import annotations
19
19
 
20
- from typing import TYPE_CHECKING, Sequence
20
+ from typing import TYPE_CHECKING, ClassVar, Sequence
21
21
 
22
22
  from airflow.providers.amazon.aws.hooks.dms import DmsHook
23
23
  from airflow.providers.amazon.aws.operators.base_aws import AwsBaseOperator
@@ -64,7 +64,7 @@ class DmsCreateTaskOperator(AwsBaseOperator[DmsHook]):
64
64
  "migration_type",
65
65
  "create_task_kwargs",
66
66
  )
67
- template_fields_renderers = {
67
+ template_fields_renderers: ClassVar[dict] = {
68
68
  "table_mappings": "json",
69
69
  "create_task_kwargs": "json",
70
70
  }
@@ -173,7 +173,7 @@ class DmsDescribeTasksOperator(AwsBaseOperator[DmsHook]):
173
173
 
174
174
  aws_hook_class = DmsHook
175
175
  template_fields: Sequence[str] = aws_template_fields("describe_tasks_kwargs")
176
- template_fields_renderers: dict[str, str] = {"describe_tasks_kwargs": "json"}
176
+ template_fields_renderers: ClassVar[dict[str, str]] = {"describe_tasks_kwargs": "json"}
177
177
 
178
178
  def __init__(self, *, describe_tasks_kwargs: dict | None = None, **kwargs):
179
179
  super().__init__(**kwargs)
@@ -16,7 +16,7 @@
16
16
  # under the License.
17
17
  from __future__ import annotations
18
18
 
19
- from typing import TYPE_CHECKING, Any, Sequence
19
+ from typing import TYPE_CHECKING, Any, ClassVar, Sequence
20
20
 
21
21
  from botocore.exceptions import ClientError
22
22
 
@@ -70,7 +70,7 @@ class KinesisAnalyticsV2CreateApplicationOperator(AwsBaseOperator[KinesisAnalyti
70
70
  "create_application_kwargs",
71
71
  "application_description",
72
72
  )
73
- template_fields_renderers: dict = {
73
+ template_fields_renderers: ClassVar[dict] = {
74
74
  "create_application_kwargs": "json",
75
75
  }
76
76
 
@@ -149,7 +149,7 @@ class KinesisAnalyticsV2StartApplicationOperator(AwsBaseOperator[KinesisAnalytic
149
149
  "application_name",
150
150
  "run_configuration",
151
151
  )
152
- template_fields_renderers: dict = {
152
+ template_fields_renderers: ClassVar[dict] = {
153
153
  "run_configuration": "json",
154
154
  }
155
155
 
@@ -20,7 +20,7 @@ import datetime
20
20
  import json
21
21
  import time
22
22
  from functools import cached_property
23
- from typing import TYPE_CHECKING, Any, Callable, Sequence
23
+ from typing import TYPE_CHECKING, Any, Callable, ClassVar, Sequence
24
24
 
25
25
  from botocore.exceptions import ClientError
26
26
 
@@ -65,7 +65,7 @@ class SageMakerBaseOperator(BaseOperator):
65
65
 
66
66
  template_fields: Sequence[str] = ("config",)
67
67
  template_ext: Sequence[str] = ()
68
- template_fields_renderers: dict = {"config": "json"}
68
+ template_fields_renderers: ClassVar[dict] = {"config": "json"}
69
69
  ui_color: str = "#ededed"
70
70
  integer_fields: list[list[Any]] = []
71
71
 
@@ -130,7 +130,7 @@ def get_provider_info():
130
130
  "aiobotocore>=2.13.0",
131
131
  "aws_xray_sdk>=2.12.0",
132
132
  "moto[cloudformation,glue]>=5.0.0",
133
- "mypy-boto3-appflow>=1.34.0",
133
+ "mypy-boto3-appflow>=1.34.0,<1.35.39",
134
134
  "mypy-boto3-rds>=1.34.90",
135
135
  "mypy-boto3-redshift-data>=1.34.0",
136
136
  "mypy-boto3-s3>=1.34.90",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apache-airflow-providers-amazon
3
- Version: 9.1.0rc1
3
+ Version: 9.1.0rc2
4
4
  Summary: Provider package apache-airflow-providers-amazon for Apache Airflow
5
5
  Keywords: airflow-provider,amazon,airflow,integration
6
6
  Author-email: Apache Software Foundation <dev@airflow.apache.org>
@@ -123,7 +123,7 @@ Provides-Extra: ssh
123
123
 
124
124
  Package ``apache-airflow-providers-amazon``
125
125
 
126
- Release: ``9.1.0.rc1``
126
+ Release: ``9.1.0.rc2``
127
127
 
128
128
 
129
129
  Amazon integration (including `Amazon Web Services (AWS) <https://aws.amazon.com/>`__).
@@ -1,12 +1,12 @@
1
1
  airflow/providers/amazon/LICENSE,sha256=FFb4jd2AXnOOf7XLP04pQW6jbdhG49TxlGY6fFpCV1Y,13609
2
2
  airflow/providers/amazon/__init__.py,sha256=MuTYiz17zqZxTSbZ537dOIWjnfLeKguUmhr0_326bro,1493
3
- airflow/providers/amazon/get_provider_info.py,sha256=JnyQK8t0-7kcB2ed5tBqkxh0PtzYoFpe1yYseO_dU6I,68960
3
+ airflow/providers/amazon/get_provider_info.py,sha256=7wgRQdEmOG8E5OC8XaJhofMR2o1KKJvbbSe60w2xY3o,68969
4
4
  airflow/providers/amazon/aws/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
5
5
  airflow/providers/amazon/aws/exceptions.py,sha256=uRGNMgXvgdzfphpOTiyj74lQhjzb70J-X8n6fsx5Jog,1864
6
6
  airflow/providers/amazon/aws/assets/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
7
7
  airflow/providers/amazon/aws/assets/s3.py,sha256=wNaJiOM90-SCauD4EQneZVXMO54yDRjLPfI8D5o0-fw,1861
8
8
  airflow/providers/amazon/aws/auth_manager/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
9
- airflow/providers/amazon/aws/auth_manager/aws_auth_manager.py,sha256=0E38_x_EjV6uwMqkqe0vfmLGGCpcQKEAvnr7FPQwXTY,16625
9
+ airflow/providers/amazon/aws/auth_manager/aws_auth_manager.py,sha256=j1beAGr9NVXUCXlW8gKDCKmoGYHLV5tyvCo_pT_D6Rk,17182
10
10
  airflow/providers/amazon/aws/auth_manager/constants.py,sha256=Jdluo42InhyNGkYHB_dRtoFMpKanJLJdH0hyR9-5AZg,1050
11
11
  airflow/providers/amazon/aws/auth_manager/user.py,sha256=SoiiA3sVB1-G02qhQDSTst_25MjW4xbSE0vVDxwR-uw,1882
12
12
  airflow/providers/amazon/aws/auth_manager/avp/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
@@ -38,8 +38,8 @@ airflow/providers/amazon/aws/executors/utils/exponential_backoff_retry.py,sha256
38
38
  airflow/providers/amazon/aws/fs/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
39
39
  airflow/providers/amazon/aws/fs/s3.py,sha256=Ty9XT9c1XArkUYcQkalvNZhuoTlEg3uKy-AIzNW9LgY,4797
40
40
  airflow/providers/amazon/aws/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
41
- airflow/providers/amazon/aws/hooks/appflow.py,sha256=v7o6BgFDm8McE3JtB0oMkc80_nTP0e_u_uEDWFa0sVI,5367
42
- airflow/providers/amazon/aws/hooks/athena.py,sha256=tnck2Ts9QFVDU5MsY4_9mTULyMO9QHyMm_KTJPtCsk0,13001
41
+ airflow/providers/amazon/aws/hooks/appflow.py,sha256=-le6RsIMWIqTav7KGknsph9Td42znSm_eIYztxc_RsE,5263
42
+ airflow/providers/amazon/aws/hooks/athena.py,sha256=uUpReAMERC1rY7lSSNTHGuP8UtmiSL1wV3ECo5p2rnc,13438
43
43
  airflow/providers/amazon/aws/hooks/athena_sql.py,sha256=vFIUbMMTem3xvYAUTvW3h1ypjpKVLNck3VbrAlupVLA,6844
44
44
  airflow/providers/amazon/aws/hooks/base_aws.py,sha256=LDxXMKjlYFEhsZ0u0DsIjf7qt-Wr6aRn9NpfoNJc0nc,43630
45
45
  airflow/providers/amazon/aws/hooks/batch_client.py,sha256=w4pIsSfHyGz2rRH95cIxCHocqXwxjpYVDT9Tf3sqUso,21669
@@ -107,9 +107,9 @@ airflow/providers/amazon/aws/operators/base_aws.py,sha256=cdc5GZkl_YGDDtlV9CVsdb
107
107
  airflow/providers/amazon/aws/operators/batch.py,sha256=4H98PlZTx_pgINBoeifpBJw_dIEQb_KMSUVkvEP0y0w,21981
108
108
  airflow/providers/amazon/aws/operators/bedrock.py,sha256=PJcsRoTht4w23XG8W1B4Rl6BEJiomQLnwTcuPfMM3pI,40140
109
109
  airflow/providers/amazon/aws/operators/cloud_formation.py,sha256=-WMYq-oA8WpPN2i5aTgBenFj9-CjbeEcy9NuRCnSwpM,5066
110
- airflow/providers/amazon/aws/operators/comprehend.py,sha256=JL0UfGpAekOeRFx3IT32u3fWhMhCwTyziA_OWB6xgjk,15954
110
+ airflow/providers/amazon/aws/operators/comprehend.py,sha256=YTgHIw0UkZ4KsZTf-iaOyk8WTHATrCyylxs1oZBJagc,15984
111
111
  airflow/providers/amazon/aws/operators/datasync.py,sha256=7Kt9POmcqJXF_1ZVRLVnJV6prBwYcUcCkfFJMPtraPk,18636
112
- airflow/providers/amazon/aws/operators/dms.py,sha256=6RhUtbELAjp0LLkUWl73kdcH4MRmyTzwHi1NxOlkE0Q,12313
112
+ airflow/providers/amazon/aws/operators/dms.py,sha256=V3G5Q0Jn-lgOUBIQQu6eRLY23GWbnWJg3nN-FMIgZp8,12349
113
113
  airflow/providers/amazon/aws/operators/ec2.py,sha256=aQj6cL3nZzu0tcn3dq6RBSPsByZe8fNtn6qcpQYtlNI,17051
114
114
  airflow/providers/amazon/aws/operators/ecs.py,sha256=Zem_ooknDf3LhjP7MBxXj0MI46DXsWV7MLvhTeUjNFY,32318
115
115
  airflow/providers/amazon/aws/operators/eks.py,sha256=BAuEvi05YiqmT3XanZMWWFqKdUh45mpO7JQ4zk8h5cE,48925
@@ -119,7 +119,7 @@ airflow/providers/amazon/aws/operators/glacier.py,sha256=zxwC6lLk6sWerjlogXq6HgN
119
119
  airflow/providers/amazon/aws/operators/glue.py,sha256=m8hdF6eTyzsK3onOqt6Td0dGshhgf_XU1f4EtMb42LU,28390
120
120
  airflow/providers/amazon/aws/operators/glue_crawler.py,sha256=6646Ru_DrGjcv_hCy5EjPXcFY6pdB0bjj6ko8Wj3XDk,5253
121
121
  airflow/providers/amazon/aws/operators/glue_databrew.py,sha256=IU9S4gjy8TtwfLxZWhslbHrl8Fpw72QDmL_In8MMecw,6092
122
- airflow/providers/amazon/aws/operators/kinesis_analytics.py,sha256=Phjx24ESi2QIszD1O6OTCV_R7Wkr04qjUsASuLzCOoM,15773
122
+ airflow/providers/amazon/aws/operators/kinesis_analytics.py,sha256=psa-SiCjYUYytCZhctQUNr7GSyl38zQ5oNJ6Snt-kwM,15803
123
123
  airflow/providers/amazon/aws/operators/lambda_function.py,sha256=96KtK5KUpMPW2i8Xay1UdKPMX211hS6FqweFnRNuTFQ,10619
124
124
  airflow/providers/amazon/aws/operators/neptune.py,sha256=on5oNX5K4yHfW1POE0eeZujta71vkJdVL07vucGjX-4,14751
125
125
  airflow/providers/amazon/aws/operators/quicksight.py,sha256=jc3Eof19UfLt5IqbQswRzaHaK8h0ACLY99i_1Prtq10,4089
@@ -127,7 +127,7 @@ airflow/providers/amazon/aws/operators/rds.py,sha256=U2YLPx5MZCdDrLIyy-9K93W5aUt
127
127
  airflow/providers/amazon/aws/operators/redshift_cluster.py,sha256=rmBHCssxrYEJ8EnENY-AnzC004lbtHvxXHpy69sHtV0,36681
128
128
  airflow/providers/amazon/aws/operators/redshift_data.py,sha256=36MVojiezDyGZ_4aQuY8xvs9doQlz_SWpJEp6Kwkw0U,10832
129
129
  airflow/providers/amazon/aws/operators/s3.py,sha256=d_K2DDNXEXkoi-WZ02-bwCf244Ogiw1PBaHcbsX-8Sg,36272
130
- airflow/providers/amazon/aws/operators/sagemaker.py,sha256=nyGS6uLP3eUYPCwOXDhdlucSGvI2lrSV8PUJ1_1f_5w,82337
130
+ airflow/providers/amazon/aws/operators/sagemaker.py,sha256=-tiMnsjYU6_COMU1nHqEWlRneAmT8DJo7GXKguJGu6U,82357
131
131
  airflow/providers/amazon/aws/operators/sns.py,sha256=Rttd015UhLo4pCplGybxtLhflyu_26IFzYP7WTmQFk8,3730
132
132
  airflow/providers/amazon/aws/operators/sqs.py,sha256=0KkhhIblMggNHLxAyrv5dbWcaXvdSWQA2AOQP2CzOlo,4327
133
133
  airflow/providers/amazon/aws/operators/step_function.py,sha256=eXZAxZqG5VNPaFVEchyL4vKmOh54jc83ZjrIZDeld34,9515
@@ -249,7 +249,7 @@ airflow/providers/amazon/aws/waiters/rds.json,sha256=HNmNQm5J-VaFHzjWb1pE5P7-Ix-
249
249
  airflow/providers/amazon/aws/waiters/redshift.json,sha256=jOBotCgbkko1b_CHcGEbhhRvusgt0YSzVuFiZrqVP30,1742
250
250
  airflow/providers/amazon/aws/waiters/sagemaker.json,sha256=JPHuQtUFZ1B7EMLfVmCRevNZ9jgpB71LM0dva8ZEO9A,5254
251
251
  airflow/providers/amazon/aws/waiters/stepfunctions.json,sha256=GsOH-emGerKGBAUFmI5lpMfNGH4c0ol_PSiea25DCEY,1033
252
- apache_airflow_providers_amazon-9.1.0rc1.dist-info/entry_points.txt,sha256=vlc0ZzhBkMrav1maTRofgksnAw4SwoQLFX9cmnTgktk,102
253
- apache_airflow_providers_amazon-9.1.0rc1.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
254
- apache_airflow_providers_amazon-9.1.0rc1.dist-info/METADATA,sha256=qBjKdJd9WgtPT5L-V5k2D8IBorkkQxcQwRTKdnEXuEg,10687
255
- apache_airflow_providers_amazon-9.1.0rc1.dist-info/RECORD,,
252
+ apache_airflow_providers_amazon-9.1.0rc2.dist-info/entry_points.txt,sha256=vlc0ZzhBkMrav1maTRofgksnAw4SwoQLFX9cmnTgktk,102
253
+ apache_airflow_providers_amazon-9.1.0rc2.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
254
+ apache_airflow_providers_amazon-9.1.0rc2.dist-info/METADATA,sha256=-oMIeQQaubCW0JYv1W0iM3SqCQiH2FOGJMJt1MI2ipk,10687
255
+ apache_airflow_providers_amazon-9.1.0rc2.dist-info/RECORD,,