Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 547
Deprecate Redundant Identifier Support in TableIdentifier, and row_filter#994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
9ccc116f7c84273a94fcc9e3e2e85929c2c3ce3b653907222File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -67,7 +67,7 @@ | ||
| RecursiveDict, | ||
| ) | ||
| from pyiceberg.utils.config import Config, merge_config | ||
| from pyiceberg.utils.deprecated import deprecation_message | ||
| from pyiceberg.utils.deprecated import deprecated, deprecation_message | ||
| if TYPE_CHECKING: | ||
| import pyarrow as pa | ||
| @@ -613,6 +613,11 @@ def update_namespace_properties( | ||
| ValueError: If removals and updates have overlapping keys. | ||
| """ | ||
| @deprecated( | ||
| deprecated_in="0.8.0", | ||
| removed_in="0.9.0", | ||
| help_message="Support for parsing catalog level identifier in Catalog identifiers is deprecated. Please refer to the table using only its namespace and its table name.", | ||
| ) | ||
| def identifier_to_tuple_without_catalog(self, identifier: Union[str, Identifier]) -> Identifier: | ||
| """Convert an identifier to a tuple and drop this catalog's name from the first element. | ||
| @@ -627,6 +632,25 @@ def identifier_to_tuple_without_catalog(self, identifier: Union[str, Identifier] | ||
| identifier_tuple = identifier_tuple[1:] | ||
| return identifier_tuple | ||
| def _identifier_to_tuple_without_catalog(self, identifier: Union[str, Identifier]) -> Identifier: | ||
CollaboratorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where as this is now called by the PyIceberg functions and only prints the deprecation warning message if we are using the unsupported naming convention | ||
| """Convert an identifier to a tuple and drop this catalog's name from the first element. | ||
| Args: | ||
| identifier (str | Identifier): Table identifier. | ||
| Returns: | ||
| Identifier: a tuple of strings with this catalog's name removed | ||
| """ | ||
| identifier_tuple = Catalog.identifier_to_tuple(identifier) | ||
| if len(identifier_tuple) >= 3 and identifier_tuple[0] == self.name: | ||
| deprecation_message( | ||
| deprecated_in="0.8.0", | ||
| removed_in="0.9.0", | ||
| help_message="Support for parsing catalog level identifier in Catalog identifiers is deprecated. Please refer to the table using only its namespace and its table name.", | ||
| ) | ||
| identifier_tuple = identifier_tuple[1:] | ||
| return identifier_tuple | ||
| @staticmethod | ||
| def identifier_to_tuple(identifier: Union[str, Identifier]) -> Identifier: | ||
| """Parse an identifier to a tuple. | ||
| @@ -769,7 +793,7 @@ def table_exists(self, identifier: Union[str, Identifier]) -> bool: | ||
| return False | ||
| def purge_table(self, identifier: Union[str, Identifier]) -> None: | ||
| identifier_tuple = self.identifier_to_tuple_without_catalog(identifier) | ||
| identifier_tuple = self._identifier_to_tuple_without_catalog(identifier) | ||
| table = self.load_table(identifier_tuple) | ||
| self.drop_table(identifier_tuple) | ||
| io = load_file_io(self.properties, table.metadata_location) | ||
| @@ -823,7 +847,7 @@ def _create_staged_table( | ||
| ) | ||
| io = self._load_file_io(properties=properties, location=metadata_location) | ||
| return StagedTable( | ||
| identifier=(self.name, database_name, table_name), | ||
| identifier=(database_name, table_name), | ||
| metadata=metadata, | ||
| metadata_location=metadata_location, | ||
| io=io, | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This deprecates the public function