Skip to content

Add drop_view to the rest catalog - #820

Merged
sungwy merged 3 commits into
apache:mainfrom
ndrluis:drop-view-rest
Sep 3, 2024
Merged

Add drop_view to the rest catalog#820
sungwy merged 3 commits into
apache:mainfrom
ndrluis:drop-view-rest

Conversation

@ndrluis

Copy link
Copy Markdown
Collaborator

No description provided.

@ndrluisndrluis mentioned this pull request Jun 14, 2024
8 tasks
@ndrluisndrluis added this to the PyIceberg 0.8.0 release milestone Aug 6, 2024

@sungwysungwy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ndrluis - thank you for working on this. I like how you separated the NoSuchTable, NoSuchIdentifier and NoSuchViewErrors here. I think there's conflict resolution to handle, but otherwise looks good to merge

@ndrluis
ndrluisforce-pushed the drop-view-rest branch 2 times, most recently from 11a5fd4 to 6db3355CompareAugust 16, 2024 13:19
@ndrluis
ndrluis requested a review from sungwyAugust 16, 2024 13:24

@sungwysungwy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ndrluis - sorry for the delay in reviewing this PR. It fell through my radar :(

I left a few more nits, hope you find those comments helpful!

Comment threadpyiceberg/catalog/rest.py Outdated
Comment on lines 391 to 393
return {"namespace": NAMESPACE_SEPARATOR.join(identifier.namespace.root[1:]), "table": identifier.name}
else:
return {"namespace": NAMESPACE_SEPARATOR.join(identifier.namespace.root), "table": identifier.name}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The view identifier is also of TableIdentifier type, so I think this would be safer, and future proof (for when we support loading views):

Suggested change
return {"namespace": NAMESPACE_SEPARATOR.join(identifier.namespace.root[1:]), "table": identifier.name}
else:
return {"namespace": NAMESPACE_SEPARATOR.join(identifier.namespace.root), "table": identifier.name}
return {"namespace": NAMESPACE_SEPARATOR.join(identifier.namespace.root[1:]), kind: identifier.name}
else:
return {"namespace": NAMESPACE_SEPARATOR.join(identifier.namespace.root), kind: identifier.name}

Comment threadpyiceberg/catalog/rest.py Outdated
return identifier_tuple

def _split_identifier_for_path(self, identifier: Union[str, Identifier, TableIdentifier]) -> Properties:
def _split_identifier_for_path(self, identifier: Union[str, Identifier, TableIdentifier], kind: str = "table") -> Properties:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Should we introduce an enum instead of free form strings for the table kind? (table, view, there may be more kinds in the future like materialized views)

@ndrluis

Copy link
Copy Markdown
CollaboratorAuthor

@sungwy, thank you for your review. I will work on this tomorrow!

@ndrluis

Copy link
Copy Markdown
CollaboratorAuthor

@sungwy Done!

@sungwy

Copy link
Copy Markdown
Collaborator

LGTM! Thank you for adding this new API @ndrluis

@sungwy
sungwy merged commit 9857107 into apache:mainSep 3, 2024
@sungwysungwy mentioned this pull request Sep 3, 2024
@ndrluis
ndrluis deleted the drop-view-rest branch September 9, 2024 13:04
@shiv-ioshiv-io mentioned this pull request Nov 8, 2024
2 tasks
sungwy pushed a commit to sungwy/iceberg-python that referenced this pull request Dec 7, 2024
* Use NoSuchIdentifier instead of NoTableIdentifier
This change allows for the validation of both Tables and Views.
* Add drop_view to the rest catalog
* fixup! Add drop_view to the rest catalog
sungwy pushed a commit to sungwy/iceberg-python that referenced this pull request Dec 7, 2024
* Use NoSuchIdentifier instead of NoTableIdentifier
This change allows for the validation of both Tables and Views.
* Add drop_view to the rest catalog
* fixup! Add drop_view to the rest catalog
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@ndrluis@sungwy