You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by bl...@apache.org on 2022/08/07 21:54:15 UTC

[iceberg] branch master updated: Python: Move table module base.py classes to __init__.py (#5458)

This is an automated email from the ASF dual-hosted git repository.

blue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/master by this push:
     new b04f0cd2df Python: Move table module base.py classes to __init__.py (#5458)
b04f0cd2df is described below

commit b04f0cd2dfd78ebe52e4e8fe833bdfb02a12714e
Author: Samuel Redai <43...@users.noreply.github.com>
AuthorDate: Sun Aug 7 17:54:09 2022 -0400

    Python: Move table module base.py classes to __init__.py (#5458)
---
 python/pyiceberg/catalog/__init__.py |  2 +-
 python/pyiceberg/catalog/hive.py     |  2 +-
 python/pyiceberg/catalog/rest.py     |  2 +-
 python/pyiceberg/table/__init__.py   | 14 ++++++++++++++
 python/pyiceberg/table/base.py       | 30 ------------------------------
 python/tests/catalog/test_base.py    |  2 +-
 6 files changed, 18 insertions(+), 34 deletions(-)

diff --git a/python/pyiceberg/catalog/__init__.py b/python/pyiceberg/catalog/__init__.py
index 25063189a9..8c40d886bc 100644
--- a/python/pyiceberg/catalog/__init__.py
+++ b/python/pyiceberg/catalog/__init__.py
@@ -21,7 +21,7 @@ from abc import ABC, abstractmethod
 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
diff --git a/python/pyiceberg/catalog/hive.py b/python/pyiceberg/catalog/hive.py
index 991f800130..a34b69e970 100644
--- a/python/pyiceberg/catalog/hive.py
+++ b/python/pyiceberg/catalog/hive.py
@@ -57,7 +57,7 @@ from pyiceberg.exceptions import (
     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 (
diff --git a/python/pyiceberg/catalog/rest.py b/python/pyiceberg/catalog/rest.py
index 073996931d..5e11933fff 100644
--- a/python/pyiceberg/catalog/rest.py
+++ b/python/pyiceberg/catalog/rest.py
@@ -52,7 +52,7 @@ from pyiceberg.exceptions import (
     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
diff --git a/python/pyiceberg/table/__init__.py b/python/pyiceberg/table/__init__.py
index 13a83393a9..585ef6db04 100644
--- a/python/pyiceberg/table/__init__.py
+++ b/python/pyiceberg/table/__init__.py
@@ -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()
diff --git a/python/pyiceberg/table/base.py b/python/pyiceberg/table/base.py
deleted file mode 100644
index ad31e75cdd..0000000000
--- a/python/pyiceberg/table/base.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#  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.
-
-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()
diff --git a/python/tests/catalog/test_base.py b/python/tests/catalog/test_base.py
index 7b29aeb5da..9ac86c1f26 100644
--- a/python/tests/catalog/test_base.py
+++ b/python/tests/catalog/test_base.py
@@ -39,7 +39,7 @@ from pyiceberg.exceptions import (
     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