Skip to content

Commit

Permalink
[apache#6407] improve(client-python): Reorganize the python package (a…
Browse files Browse the repository at this point in the history
…pache#6408)

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

Move the `Fileset` and `Model` related classes to the sub-package for
better organized.

### Why are the changes needed?

For better organized.

Fix: apache#6407 

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

No.

### How was this patch tested?

Existing tests.
  • Loading branch information
jerryshao authored Feb 8, 2025
1 parent 739dcea commit e50e00e
Show file tree
Hide file tree
Showing 19 changed files with 49 additions and 17 deletions.
4 changes: 2 additions & 2 deletions clients/client-python/gravitino/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

from gravitino.api.catalog import Catalog
from gravitino.api.schema import Schema
from gravitino.api.fileset import Fileset
from gravitino.api.fileset_change import FilesetChange
from gravitino.api.file.fileset import Fileset
from gravitino.api.file.fileset_change import FilesetChange
from gravitino.api.metalake_change import MetalakeChange
from gravitino.api.schema_change import SchemaChange
from gravitino.client.gravitino_client import GravitinoClient
Expand Down
16 changes: 16 additions & 0 deletions clients/client-python/gravitino/api/file/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
16 changes: 16 additions & 0 deletions clients/client-python/gravitino/api/model/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
4 changes: 2 additions & 2 deletions clients/client-python/gravitino/client/fileset_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
from gravitino.api.catalog import Catalog
from gravitino.api.credential.supports_credentials import SupportsCredentials
from gravitino.api.credential.credential import Credential
from gravitino.api.fileset import Fileset
from gravitino.api.fileset_change import FilesetChange
from gravitino.api.file.fileset import Fileset
from gravitino.api.file.fileset_change import FilesetChange
from gravitino.audit.caller_context import CallerContextHolder, CallerContext
from gravitino.client.base_schema_catalog import BaseSchemaCatalog
from gravitino.client.generic_fileset import GenericFileset
Expand Down
2 changes: 1 addition & 1 deletion clients/client-python/gravitino/client/generic_fileset.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
from typing import Optional, Dict, List

from gravitino.api.fileset import Fileset
from gravitino.api.file.fileset import Fileset
from gravitino.api.metadata_object import MetadataObject
from gravitino.api.credential.supports_credentials import SupportsCredentials
from gravitino.api.credential.credential import Credential
Expand Down
2 changes: 1 addition & 1 deletion clients/client-python/gravitino/client/generic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
from typing import Optional

from gravitino.api.model import Model
from gravitino.api.model.model import Model
from gravitino.dto.audit_dto import AuditDTO
from gravitino.dto.model_dto import ModelDTO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

from gravitino.name_identifier import NameIdentifier
from gravitino.api.catalog import Catalog
from gravitino.api.model import Model
from gravitino.api.model_version import ModelVersion
from gravitino.api.model.model import Model
from gravitino.api.model.model_version import ModelVersion
from gravitino.client.base_schema_catalog import BaseSchemaCatalog
from gravitino.client.generic_model import GenericModel
from gravitino.client.generic_model_version import GenericModelVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
from typing import Optional, Dict, List

from gravitino.api.model_version import ModelVersion
from gravitino.api.model.model_version import ModelVersion
from gravitino.dto.audit_dto import AuditDTO
from gravitino.dto.model_version_dto import ModelVersionDTO

Expand Down
2 changes: 1 addition & 1 deletion clients/client-python/gravitino/dto/fileset_dto.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from dataclasses_json import config, DataClassJsonMixin

from gravitino.api.fileset import Fileset
from gravitino.api.file.fileset import Fileset
from gravitino.dto.audit_dto import AuditDTO


Expand Down
2 changes: 1 addition & 1 deletion clients/client-python/gravitino/dto/model_dto.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from dataclasses_json import DataClassJsonMixin, config

from gravitino.api.model import Model
from gravitino.api.model.model import Model
from gravitino.dto.audit_dto import AuditDTO


Expand Down
2 changes: 1 addition & 1 deletion clients/client-python/gravitino/dto/model_version_dto.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from dataclasses_json import DataClassJsonMixin, config

from gravitino.api.model_version import ModelVersion
from gravitino.api.model.model_version import ModelVersion
from gravitino.dto.audit_dto import AuditDTO


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from dataclasses_json import config

from gravitino.api.fileset import Fileset
from gravitino.api.file.fileset import Fileset
from gravitino.rest.rest_message import RESTRequest


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from dataclasses_json import config

from gravitino.api.fileset_change import FilesetChange
from gravitino.api.file.fileset_change import FilesetChange
from gravitino.rest.rest_message import RESTRequest


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from unittest.mock import Mock, patch

from gravitino import NameIdentifier, GravitinoClient
from gravitino.api.model import Model
from gravitino.api.model_version import ModelVersion
from gravitino.api.model.model import Model
from gravitino.api.model.model_version import ModelVersion
from gravitino.dto.audit_dto import AuditDTO
from gravitino.dto.model_dto import ModelDTO
from gravitino.dto.model_version_dto import ModelVersionDTO
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to-use-gvfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,4 +585,4 @@ options = {
}
fs = gvfs.GravitinoVirtualFileSystem(server_uri="http://localhost:8090", metalake_name="test_metalake", options=options)
print(fs.ls("gvfs://fileset/fileset_catlaog/tmp/test_fileset"))
```
```

0 comments on commit e50e00e

Please sign in to comment.