Skip to content

Commit 6d39cb4

Browse files
committed
Use deprecation_message instead of deprecated for property deprecation
1 parent 0830fdc commit 6d39cb4

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

pyiceberg/catalog/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
RecursiveDict,
6868
)
6969
from pyiceberg.utils.config import Config, merge_config
70-
from pyiceberg.utils.deprecated import deprecated
70+
from pyiceberg.utils.deprecated import deprecation_message
7171

7272
if TYPE_CHECKING:
7373
import pyarrow as pa
@@ -742,11 +742,11 @@ def __init__(self, name: str, **properties: str):
742742

743743
for property_name in DEPRECATED_PROPERTY_NAMES:
744744
if self.properties.get(property_name):
745-
deprecated(
745+
deprecation_message(
746746
deprecated_in="0.7.0",
747747
removed_in="0.8.0",
748748
help_message=f"The property {property_name} is deprecated. Please use properties that start with client., glue., and dynamo. instead",
749-
)(lambda: None)()
749+
)
750750

751751
def create_table_transaction(
752752
self,

pyiceberg/catalog/rest.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
CommitTableRequest,
6464
CommitTableResponse,
6565
CreateTableTransaction,
66-
PropertyUtil,
6766
StagedTable,
6867
Table,
6968
TableIdentifier,
@@ -73,7 +72,7 @@
7372
from pyiceberg.typedef import EMPTY_DICT, UTF8, IcebergBaseModel, Identifier, Properties
7473
from pyiceberg.types import transform_dict_value_to_str
7574
from pyiceberg.utils.deprecated import deprecation_message
76-
from pyiceberg.utils.properties import property_as_bool
75+
from pyiceberg.utils.properties import get_first_property_value, property_as_bool
7776

7877
if TYPE_CHECKING:
7978
import pyarrow as pa
@@ -303,7 +302,7 @@ def auth_url(self) -> str:
303302

304303
self._warn_oauth_tokens_deprecation()
305304

306-
if url := PropertyUtil.get_first_property_value(self.properties, AUTH_URL, OAUTH2_SERVER_URI):
305+
if url := get_first_property_value(self.properties, AUTH_URL, OAUTH2_SERVER_URI):
307306
return url
308307
else:
309308
return self.url(Endpoints.get_token, prefixed=False)
@@ -312,7 +311,7 @@ def _warn_oauth_tokens_deprecation(self) -> None:
312311
has_oauth_server_uri = OAUTH2_SERVER_URI in self.properties
313312
has_credential = CREDENTIAL in self.properties
314313
has_init_token = TOKEN in self.properties
315-
has_sigv4_enabled = strtobool(self.properties.get(SIGV4, "false"))
314+
has_sigv4_enabled = property_as_bool(self.properties, SIGV4, False)
316315

317316
if not has_oauth_server_uri and (has_init_token or has_credential) and not has_sigv4_enabled:
318317
deprecation_message(

0 commit comments

Comments
 (0)