Skip to content

Commit 8cb8793

Browse files
authored
AWS: Undeprecate botocore_session (#1692)
We've deprecated this a while ago, because as the configuration should only pass in strings, and not Python objects. However, it was pretty complex to find a reasonable alternative for this. For example: #1299 Therefore, I think we should undo this deprecation for now.
1 parent d1fea5c commit 8cb8793

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

pyiceberg/catalog/__init__.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@
7272
RecursiveDict,
7373
)
7474
from pyiceberg.utils.config import Config, merge_config
75-
from pyiceberg.utils.deprecated import deprecated as deprecated
76-
from pyiceberg.utils.deprecated import deprecation_message
7775
from pyiceberg.utils.properties import property_as_bool
7876

7977
if TYPE_CHECKING:
@@ -98,6 +96,7 @@
9896
URI = "uri"
9997
LOCATION = "location"
10098
EXTERNAL_TABLE = "EXTERNAL_TABLE"
99+
BOTOCORE_SESSION = "botocore_session"
101100

102101
TABLE_METADATA_FILE_NAME_REGEX = re.compile(
103102
r"""
@@ -110,8 +109,6 @@
110109
re.X,
111110
)
112111

113-
DEPRECATED_BOTOCORE_SESSION = "botocore_session"
114-
115112

116113
class CatalogType(Enum):
117114
REST = "rest"
@@ -784,13 +781,6 @@ class MetastoreCatalog(Catalog, ABC):
784781
def __init__(self, name: str, **properties: str):
785782
super().__init__(name, **properties)
786783

787-
if self.properties.get(DEPRECATED_BOTOCORE_SESSION):
788-
deprecation_message(
789-
deprecated_in="0.8.0",
790-
removed_in="0.9.0",
791-
help_message=f"The property {DEPRECATED_BOTOCORE_SESSION} is deprecated and will be removed.",
792-
)
793-
794784
def create_table_transaction(
795785
self,
796786
identifier: Union[str, Identifier],

pyiceberg/catalog/dynamodb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import boto3
3131

3232
from pyiceberg.catalog import (
33-
DEPRECATED_BOTOCORE_SESSION,
33+
BOTOCORE_SESSION,
3434
ICEBERG,
3535
METADATA_LOCATION,
3636
PREVIOUS_METADATA_LOCATION,
@@ -100,7 +100,7 @@ def __init__(self, name: str, **properties: str):
100100
session = boto3.Session(
101101
profile_name=properties.get(DYNAMODB_PROFILE_NAME),
102102
region_name=get_first_property_value(properties, DYNAMODB_REGION, AWS_REGION),
103-
botocore_session=properties.get(DEPRECATED_BOTOCORE_SESSION),
103+
botocore_session=properties.get(BOTOCORE_SESSION),
104104
aws_access_key_id=get_first_property_value(properties, DYNAMODB_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID),
105105
aws_secret_access_key=get_first_property_value(properties, DYNAMODB_SECRET_ACCESS_KEY, AWS_SECRET_ACCESS_KEY),
106106
aws_session_token=get_first_property_value(properties, DYNAMODB_SESSION_TOKEN, AWS_SESSION_TOKEN),

pyiceberg/catalog/glue.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
)
4242

4343
from pyiceberg.catalog import (
44-
DEPRECATED_BOTOCORE_SESSION,
44+
BOTOCORE_SESSION,
4545
EXTERNAL_TABLE,
4646
ICEBERG,
4747
LOCATION,
@@ -311,7 +311,7 @@ def __init__(self, name: str, **properties: Any):
311311
session = boto3.Session(
312312
profile_name=properties.get(GLUE_PROFILE_NAME),
313313
region_name=get_first_property_value(properties, GLUE_REGION, AWS_REGION),
314-
botocore_session=properties.get(DEPRECATED_BOTOCORE_SESSION),
314+
botocore_session=properties.get(BOTOCORE_SESSION),
315315
aws_access_key_id=get_first_property_value(properties, GLUE_ACCESS_KEY_ID, AWS_ACCESS_KEY_ID),
316316
aws_secret_access_key=get_first_property_value(properties, GLUE_SECRET_ACCESS_KEY, AWS_SECRET_ACCESS_KEY),
317317
aws_session_token=get_first_property_value(properties, GLUE_SESSION_TOKEN, AWS_SESSION_TOKEN),

0 commit comments

Comments
 (0)