Skip to content

Commit

Permalink
[apache#6409] fix(client-python): Change to use GenericFileset for …
Browse files Browse the repository at this point in the history
…the return value of fileset catalog (apache#6410)

### What changes were proposed in this pull request?

This PR changes the return value to `GenericFileset` for fileset
operation.

### Why are the changes needed?

Previously, it returns the plain fileset dto, so that it cannot support
some operations like get credentials.

Fix: apache#6409 

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Existing tests.
  • Loading branch information
jerryshao authored and Abyss-lord committed Feb 11, 2025
1 parent cb9d599 commit 00636fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clients/client-python/gravitino/client/fileset_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def create_fileset(
fileset_resp = FilesetResponse.from_json(resp.body, infer_missing=True)
fileset_resp.validate()

return fileset_resp.fileset()
return GenericFileset(fileset_resp.fileset(), self.rest_client, full_namespace)

def alter_fileset(self, ident: NameIdentifier, *changes) -> Fileset:
"""Update a fileset metadata in the catalog.
Expand All @@ -187,7 +187,7 @@ def alter_fileset(self, ident: NameIdentifier, *changes) -> Fileset:
ident: A fileset identifier, which should be "schema.fileset" format.
changes: The changes to apply to the fileset.
Args:
Raises:
IllegalArgumentException If the changes are invalid.
NoSuchFilesetException If the fileset does not exist.
Expand All @@ -212,7 +212,7 @@ def alter_fileset(self, ident: NameIdentifier, *changes) -> Fileset:
fileset_resp = FilesetResponse.from_json(resp.body, infer_missing=True)
fileset_resp.validate()

return fileset_resp.fileset()
return GenericFileset(fileset_resp.fileset(), self.rest_client, full_namespace)

def drop_fileset(self, ident: NameIdentifier) -> bool:
"""Drop a fileset from the catalog.
Expand Down

0 comments on commit 00636fe

Please sign in to comment.