Skip to content

Commit

Permalink
Python: Move table module base.py classes to __init__.py (apache#5458)
Browse files Browse the repository at this point in the history
  • Loading branch information
samredai authored Aug 7, 2022
1 parent 102f51f commit b04f0cd
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 34 deletions.
2 changes: 1 addition & 1 deletion python/pyiceberg/catalog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from dataclasses import dataclass

from pyiceberg.schema import Schema
from pyiceberg.table.base import Table
from pyiceberg.table import Table
from pyiceberg.table.partitioning import UNPARTITIONED_PARTITION_SPEC, PartitionSpec
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
from pyiceberg.typedef import Identifier, Properties
Expand Down
2 changes: 1 addition & 1 deletion python/pyiceberg/catalog/hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
TableAlreadyExistsError,
)
from pyiceberg.schema import Schema
from pyiceberg.table.base import Table
from pyiceberg.table import Table
from pyiceberg.table.partitioning import PartitionSpec
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
from pyiceberg.types import (
Expand Down
2 changes: 1 addition & 1 deletion python/pyiceberg/catalog/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
UnauthorizedError,
)
from pyiceberg.schema import Schema
from pyiceberg.table.base import Table
from pyiceberg.table import Table
from pyiceberg.table.metadata import TableMetadataV1, TableMetadataV2
from pyiceberg.table.partitioning import UNPARTITIONED_PARTITION_SPEC, PartitionSpec
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
Expand Down
14 changes: 14 additions & 0 deletions python/pyiceberg/table/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,17 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

from typing import Optional, Union

from pydantic import Field

from pyiceberg.table.metadata import TableMetadataV1, TableMetadataV2
from pyiceberg.typedef import Identifier
from pyiceberg.utils.iceberg_base_model import IcebergBaseModel


class Table(IcebergBaseModel):
identifier: Identifier = Field()
metadata_location: Optional[str] = Field()
metadata: Optional[Union[TableMetadataV1, TableMetadataV2]] = Field()
30 changes: 0 additions & 30 deletions python/pyiceberg/table/base.py

This file was deleted.

2 changes: 1 addition & 1 deletion python/tests/catalog/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
TableAlreadyExistsError,
)
from pyiceberg.schema import Schema
from pyiceberg.table.base import Table
from pyiceberg.table import Table
from pyiceberg.table.metadata import INITIAL_SPEC_ID
from pyiceberg.table.partitioning import UNPARTITIONED_PARTITION_SPEC, PartitionSpec
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
Expand Down

0 comments on commit b04f0cd

Please sign in to comment.