Skip to content

Commit eae0dfa

Browse files
committed
remove deprecated properties
1 parent f3db466 commit eae0dfa

File tree

6 files changed

+10
-73
lines changed

6 files changed

+10
-73
lines changed

pyiceberg/catalog/__init__.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -106,21 +106,6 @@
106106
re.X,
107107
)
108108

109-
DEPRECATED_PROFILE_NAME = "profile_name"
110-
DEPRECATED_REGION = "region_name"
111-
DEPRECATED_BOTOCORE_SESSION = "botocore_session"
112-
DEPRECATED_ACCESS_KEY_ID = "aws_access_key_id"
113-
DEPRECATED_SECRET_ACCESS_KEY = "aws_secret_access_key"
114-
DEPRECATED_SESSION_TOKEN = "aws_session_token"
115-
DEPRECATED_PROPERTY_NAMES = {
116-
DEPRECATED_PROFILE_NAME,
117-
DEPRECATED_REGION,
118-
DEPRECATED_BOTOCORE_SESSION,
119-
DEPRECATED_ACCESS_KEY_ID,
120-
DEPRECATED_SECRET_ACCESS_KEY,
121-
DEPRECATED_SESSION_TOKEN,
122-
}
123-
124109

125110
class CatalogType(Enum):
126111
REST = "rest"
@@ -794,14 +779,6 @@ class MetastoreCatalog(Catalog, ABC):
794779
def __init__(self, name: str, **properties: str):
795780
super().__init__(name, **properties)
796781

797-
for property_name in DEPRECATED_PROPERTY_NAMES:
798-
if self.properties.get(property_name):
799-
deprecation_message(
800-
deprecated_in="0.7.0",
801-
removed_in="0.8.0",
802-
help_message=f"The property {property_name} is deprecated. Please use properties that start with client., glue., and dynamo. instead",
803-
)
804-
805782
def create_table_transaction(
806783
self,
807784
identifier: Union[str, Identifier],

pyiceberg/catalog/dynamodb.py

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@
3030
import boto3
3131

3232
from pyiceberg.catalog import (
33-
DEPRECATED_ACCESS_KEY_ID,
34-
DEPRECATED_BOTOCORE_SESSION,
35-
DEPRECATED_PROFILE_NAME,
36-
DEPRECATED_REGION,
37-
DEPRECATED_SECRET_ACCESS_KEY,
38-
DEPRECATED_SESSION_TOKEN,
3933
ICEBERG,
4034
METADATA_LOCATION,
4135
PREVIOUS_METADATA_LOCATION,
@@ -102,18 +96,11 @@ def __init__(self, name: str, **properties: str):
10296
super().__init__(name, **properties)
10397

10498
session = boto3.Session(
105-
profile_name=get_first_property_value(properties, DYNAMODB_PROFILE_NAME, DEPRECATED_PROFILE_NAME),
106-
region_name=get_first_property_value(properties, DYNAMODB_REGION, AWS_REGION, DEPRECATED_REGION),
107-
botocore_session=properties.get(DEPRECATED_BOTOCORE_SESSION),
108-
aws_access_key_id=get_first_property_value(
109-
properties, DYNAMODB_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID, DEPRECATED_ACCESS_KEY_ID
110-
),
111-
aws_secret_access_key=get_first_property_value(
112-
properties, DYNAMODB_SECRET_ACCESS_KEY, AWS_SECRET_ACCESS_KEY, DEPRECATED_SECRET_ACCESS_KEY
113-
),
114-
aws_session_token=get_first_property_value(
115-
properties, DYNAMODB_SESSION_TOKEN, AWS_SESSION_TOKEN, DEPRECATED_SESSION_TOKEN
116-
),
99+
profile_name=get_first_property_value(properties, DYNAMODB_PROFILE_NAME),
100+
region_name=get_first_property_value(properties, DYNAMODB_REGION, AWS_REGION),
101+
aws_access_key_id=get_first_property_value(properties, DYNAMODB_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID),
102+
aws_secret_access_key=get_first_property_value(properties, DYNAMODB_SECRET_ACCESS_KEY, AWS_SECRET_ACCESS_KEY),
103+
aws_session_token=get_first_property_value(properties, DYNAMODB_SESSION_TOKEN, AWS_SESSION_TOKEN),
117104
)
118105
self.dynamodb = session.client(DYNAMODB_CLIENT)
119106
self.dynamodb_table_name = self.properties.get(DYNAMODB_TABLE_NAME, DYNAMODB_TABLE_NAME_DEFAULT)

pyiceberg/catalog/glue.py

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@
4040
)
4141

4242
from pyiceberg.catalog import (
43-
DEPRECATED_ACCESS_KEY_ID,
44-
DEPRECATED_BOTOCORE_SESSION,
45-
DEPRECATED_PROFILE_NAME,
46-
DEPRECATED_REGION,
47-
DEPRECATED_SECRET_ACCESS_KEY,
48-
DEPRECATED_SESSION_TOKEN,
4943
EXTERNAL_TABLE,
5044
ICEBERG,
5145
LOCATION,
@@ -303,18 +297,11 @@ def __init__(self, name: str, **properties: Any):
303297
super().__init__(name, **properties)
304298

305299
session = boto3.Session(
306-
profile_name=get_first_property_value(properties, GLUE_PROFILE_NAME, DEPRECATED_PROFILE_NAME),
307-
region_name=get_first_property_value(properties, GLUE_REGION, AWS_REGION, DEPRECATED_REGION),
308-
botocore_session=properties.get(DEPRECATED_BOTOCORE_SESSION),
309-
aws_access_key_id=get_first_property_value(
310-
properties, GLUE_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID, DEPRECATED_ACCESS_KEY_ID
311-
),
312-
aws_secret_access_key=get_first_property_value(
313-
properties, GLUE_SECRET_ACCESS_KEY, AWS_SECRET_ACCESS_KEY, DEPRECATED_SECRET_ACCESS_KEY
314-
),
315-
aws_session_token=get_first_property_value(
316-
properties, GLUE_SESSION_TOKEN, AWS_SESSION_TOKEN, DEPRECATED_SESSION_TOKEN
317-
),
300+
profile_name=get_first_property_value(properties, GLUE_PROFILE_NAME),
301+
region_name=get_first_property_value(properties, GLUE_REGION, AWS_REGION),
302+
aws_access_key_id=get_first_property_value(properties, GLUE_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID),
303+
aws_secret_access_key=get_first_property_value(properties, GLUE_SECRET_ACCESS_KEY, AWS_SECRET_ACCESS_KEY),
304+
aws_session_token=get_first_property_value(properties, GLUE_SESSION_TOKEN, AWS_SESSION_TOKEN),
318305
)
319306
self.glue: GlueClient = session.client("glue", endpoint_url=properties.get(GLUE_CATALOG_ENDPOINT))
320307

tests/catalog/test_dynamodb.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
from pyiceberg.typedef import Properties
4646
from tests.conftest import (
4747
BUCKET_NAME,
48-
DEPRECATED_AWS_SESSION_PROPERTIES,
4948
TABLE_METADATA_LOCATION_REGEX,
5049
UNIFIED_AWS_SESSION_PROPERTIES,
5150
)
@@ -594,7 +593,6 @@ def test_passing_glue_session_properties() -> None:
594593
"dynamodb.region": "dynamodb.region",
595594
"dynamodb.session-token": "dynamodb.session-token",
596595
**UNIFIED_AWS_SESSION_PROPERTIES,
597-
**DEPRECATED_AWS_SESSION_PROPERTIES,
598596
}
599597

600598
with mock.patch("boto3.Session") as mock_session:
@@ -619,7 +617,6 @@ def test_passing_unified_session_properties_to_dynamodb() -> None:
619617
session_properties: Properties = {
620618
"dynamodb.profile-name": "dynamodb.profile-name",
621619
**UNIFIED_AWS_SESSION_PROPERTIES,
622-
**DEPRECATED_AWS_SESSION_PROPERTIES,
623620
}
624621

625622
with mock.patch("boto3.Session") as mock_session:

tests/catalog/test_glue.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
from pyiceberg.types import IntegerType
4141
from tests.conftest import (
4242
BUCKET_NAME,
43-
DEPRECATED_AWS_SESSION_PROPERTIES,
4443
TABLE_METADATA_LOCATION_REGEX,
4544
UNIFIED_AWS_SESSION_PROPERTIES,
4645
)
@@ -667,7 +666,6 @@ def test_passing_glue_session_properties() -> None:
667666
"glue.region": "glue.region",
668667
"glue.session-token": "glue.session-token",
669668
**UNIFIED_AWS_SESSION_PROPERTIES,
670-
**DEPRECATED_AWS_SESSION_PROPERTIES,
671669
}
672670

673671
with mock.patch("boto3.Session") as mock_session:
@@ -689,7 +687,6 @@ def test_passing_unified_session_properties_to_glue() -> None:
689687
session_properties: Properties = {
690688
"glue.profile-name": "glue.profile-name",
691689
**UNIFIED_AWS_SESSION_PROPERTIES,
692-
**DEPRECATED_AWS_SESSION_PROPERTIES,
693690
}
694691

695692
with mock.patch("boto3.Session") as mock_session:

tests/conftest.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,14 +2029,6 @@ def hierarchical_namespace_list(hierarchical_namespace_name: str) -> List[str]:
20292029
re.X,
20302030
)
20312031

2032-
DEPRECATED_AWS_SESSION_PROPERTIES = {
2033-
"aws_access_key_id": "aws_access_key_id",
2034-
"aws_secret_access_key": "aws_secret_access_key",
2035-
"aws_session_token": "aws_session_token",
2036-
"region_name": "region_name",
2037-
"profile_name": "profile_name",
2038-
}
2039-
20402032
UNIFIED_AWS_SESSION_PROPERTIES = {
20412033
"client.access-key-id": "client.access-key-id",
20422034
"client.secret-access-key": "client.secret-access-key",

0 commit comments

Comments
 (0)