Add create_sql_view method to Catalog#3415
Conversation
rambleraptor
left a comment
There was a problem hiding this comment.
I'm lightly opinionated on making this a helper function that takes in a Catalog, rather than a new method on the Catalog itself.
abnobdoss
left a comment
There was a problem hiding this comment.
This looks good! Left a few minor comments.
|
|
||
| Args: | ||
| identifier (str | Identifier): View identifier. | ||
| schema (Schema): View's schema. |
There was a problem hiding this comment.
| schema (Schema): View's schema. | |
| schema (Schema | pa.Schema): View's schema. |
| properties: Properties = EMPTY_DICT, | ||
| default_catalog: str | None = None, | ||
| ) -> View: | ||
| """Create a view. |
There was a problem hiding this comment.
Should this description be different from create_view?
|
|
||
| view_version = ViewVersion( | ||
| version_id=1, | ||
| schema_id=iceberg_schema.schema_id, |
There was a problem hiding this comment.
is this schema_id discarded later in the self.create_view call later?
|
|
||
|
|
||
| @pytest.mark.integration | ||
| def test_rest_create_sql_view( |
There was a problem hiding this comment.
The create_sql_view function has a few permutations of accepted values - e.g. default_namespace accepts both str & Identifier. Could we expand the test coverage to cover the various signature paths?
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that's incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
Rationale for this change
PyIceberg users currently need to provide a redundant object when creating a view.
We could internally initialize
version_id,schema_id, andtimestamp_msfields. This PR introduces a newcreate_sql_viewmethod.Are these changes tested?
Yes
Are there any user-facing changes?
Add
create_sql_viewmethod toCatalog