|
63 | 63 | CommitTableRequest,
|
64 | 64 | CommitTableResponse,
|
65 | 65 | CreateTableTransaction,
|
| 66 | + PropertyUtil, |
66 | 67 | StagedTable,
|
67 | 68 | Table,
|
68 | 69 | TableIdentifier,
|
|
71 | 72 | from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder, assign_fresh_sort_order_ids
|
72 | 73 | from pyiceberg.typedef import EMPTY_DICT, UTF8, IcebergBaseModel, Identifier, Properties
|
73 | 74 | from pyiceberg.types import transform_dict_value_to_str
|
| 75 | +from pyiceberg.utils.deprecated import deprecated |
74 | 76 |
|
75 | 77 | if TYPE_CHECKING:
|
76 | 78 | import pyarrow as pa
|
@@ -118,7 +120,8 @@ class Endpoints:
|
118 | 120 | SIGV4 = "rest.sigv4-enabled"
|
119 | 121 | SIGV4_REGION = "rest.signing-region"
|
120 | 122 | SIGV4_SERVICE = "rest.signing-name"
|
121 |
| -AUTH_URL = "rest.authorization-url" |
| 123 | +DEPRECATED_AUTH_URL = "rest.authorization-url" |
| 124 | +OAUTH2_SERVER_URI = "oauth2-server-uri" |
122 | 125 | HEADER_PREFIX = "header."
|
123 | 126 |
|
124 | 127 | NAMESPACE_SEPARATOR = b"\x1f".decode(UTF8)
|
@@ -290,7 +293,14 @@ def url(self, endpoint: str, prefixed: bool = True, **kwargs: Any) -> str:
|
290 | 293 |
|
291 | 294 | @property
|
292 | 295 | def auth_url(self) -> str:
|
293 |
| - if url := self.properties.get(AUTH_URL): |
| 296 | + if self.properties.get(DEPRECATED_AUTH_URL): |
| 297 | + deprecated( |
| 298 | + deprecated_in="0.7.0", |
| 299 | + removed_in="0.8.0", |
| 300 | + help_message=f"The property {DEPRECATED_AUTH_URL} is deprecated. Please use {OAUTH2_SERVER_URI} instead", |
| 301 | + )(lambda: None)() |
| 302 | + |
| 303 | + if url := PropertyUtil.get_first_property_value(self.properties, DEPRECATED_AUTH_URL, OAUTH2_SERVER_URI): |
294 | 304 | return url
|
295 | 305 | else:
|
296 | 306 | return self.url(Endpoints.get_token, prefixed=False)
|
|
0 commit comments