Skip to content

Commit 7a45a92

Browse files
Make amazon provider compatible with mypy 1.16.1 (#53088)
1 parent a5211f2 commit 7a45a92

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

providers/amazon/src/airflow/providers/amazon/aws/hooks/redshift_cluster.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def create_cluster(
7777
return response
7878

7979
# TODO: Wrap create_cluster_snapshot
80-
def cluster_status(self, cluster_identifier: str) -> str:
80+
def cluster_status(self, cluster_identifier: str) -> Any | None:
8181
"""
8282
Get status of a cluster.
8383
@@ -92,7 +92,7 @@ def cluster_status(self, cluster_identifier: str) -> str:
9292
except self.conn.exceptions.ClusterNotFoundFault:
9393
return "cluster_not_found"
9494

95-
async def cluster_status_async(self, cluster_identifier: str) -> str:
95+
async def cluster_status_async(self, cluster_identifier: str) -> Any | None:
9696
async with await self.get_async_conn() as client:
9797
response = await client.describe_clusters(ClusterIdentifier=cluster_identifier)
9898
return response["Clusters"][0]["ClusterStatus"] if response else None
@@ -139,7 +139,7 @@ def describe_cluster_snapshots(self, cluster_identifier: str) -> list[str] | Non
139139
snapshots.sort(key=lambda x: x["SnapshotCreateTime"], reverse=True)
140140
return snapshots
141141

142-
def restore_from_cluster_snapshot(self, cluster_identifier: str, snapshot_identifier: str) -> str:
142+
def restore_from_cluster_snapshot(self, cluster_identifier: str, snapshot_identifier: str) -> Any | None:
143143
"""
144144
Restore a cluster from its snapshot.
145145
@@ -160,7 +160,7 @@ def create_cluster_snapshot(
160160
cluster_identifier: str,
161161
retention_period: int = -1,
162162
tags: list[Any] | None = None,
163-
) -> str:
163+
) -> Any | None:
164164
"""
165165
Create a snapshot of a cluster.
166166

providers/amazon/tests/unit/amazon/aws/utils/eks_test_constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ class NodegroupInputs:
135135
class PossibleTestResults(Enum):
136136
"""Possible test results."""
137137

138-
SUCCESS: str = "SUCCESS"
139-
FAILURE: str = "FAILURE"
138+
SUCCESS = "SUCCESS"
139+
FAILURE = "FAILURE"
140140

141141

142142
class ClusterAttributes:

0 commit comments

Comments
 (0)