-
Notifications
You must be signed in to change notification settings - Fork 194
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
Deprecate Redundant Identifier Support in TableIdentifier, and row_filter #994
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9ccc116
deprecate usage of catalog in table identifier
sungwy f7c8427
deprecate usage of table name in row_filter expression
sungwy 3a94fcc
add a test with nested namespace
sungwy 9e3e2e8
better deprecation strategy
sungwy 5929c2c
lint
sungwy 3ce3b65
Merge branch 'main' into depr-higher-identifier-support
sungwy 3907222
stray print
sungwy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
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, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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