Skip to content

Commit d587e67

Browse files
authored
Refactoring: Break down very large table/__init__.py module (#1144)
* split up table module * refactoring * license
1 parent b1a6790 commit d587e67

File tree

17 files changed

+3400
-3126
lines changed

17 files changed

+3400
-3126
lines changed

pyiceberg/catalog/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,14 @@
5555
CreateTableTransaction,
5656
StagedTable,
5757
Table,
58+
)
59+
from pyiceberg.table.metadata import TableMetadata, TableMetadataV1, new_table_metadata
60+
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
61+
from pyiceberg.table.update import (
5862
TableRequirement,
5963
TableUpdate,
6064
update_table_metadata,
6165
)
62-
from pyiceberg.table.metadata import TableMetadata, TableMetadataV1, new_table_metadata
63-
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
6466
from pyiceberg.typedef import (
6567
EMPTY_DICT,
6668
Identifier,

pyiceberg/catalog/dynamodb.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@
5858
from pyiceberg.partitioning import UNPARTITIONED_PARTITION_SPEC, PartitionSpec
5959
from pyiceberg.schema import Schema
6060
from pyiceberg.serializers import FromInputFile
61-
from pyiceberg.table import CommitTableResponse, Table, TableRequirement, TableUpdate
61+
from pyiceberg.table import CommitTableResponse, Table
6262
from pyiceberg.table.metadata import new_table_metadata
6363
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
64+
from pyiceberg.table.update import (
65+
TableRequirement,
66+
TableUpdate,
67+
)
6468
from pyiceberg.typedef import EMPTY_DICT, Identifier, Properties
6569
from pyiceberg.utils.properties import get_first_property_value
6670

pyiceberg/catalog/glue.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@
7272
from pyiceberg.table import (
7373
CommitTableResponse,
7474
Table,
75-
TableRequirement,
76-
TableUpdate,
7775
)
7876
from pyiceberg.table.metadata import TableMetadata
7977
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
78+
from pyiceberg.table.update import (
79+
TableRequirement,
80+
TableUpdate,
81+
)
8082
from pyiceberg.typedef import EMPTY_DICT, Identifier, Properties
8183
from pyiceberg.types import (
8284
BinaryType,

pyiceberg/catalog/hive.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,12 @@
8484
StagedTable,
8585
Table,
8686
TableProperties,
87+
)
88+
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
89+
from pyiceberg.table.update import (
8790
TableRequirement,
8891
TableUpdate,
8992
)
90-
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
9193
from pyiceberg.typedef import EMPTY_DICT, Identifier, Properties
9294
from pyiceberg.types import (
9395
BinaryType,

pyiceberg/catalog/noop.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@
3030
CommitTableResponse,
3131
CreateTableTransaction,
3232
Table,
33+
)
34+
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
35+
from pyiceberg.table.update import (
3336
TableRequirement,
3437
TableUpdate,
3538
)
36-
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
3739
from pyiceberg.typedef import EMPTY_DICT, Identifier, Properties
3840

3941
if TYPE_CHECKING:

pyiceberg/catalog/rest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,13 @@
6969
StagedTable,
7070
Table,
7171
TableIdentifier,
72-
TableRequirement,
73-
TableUpdate,
7472
)
7573
from pyiceberg.table.metadata import TableMetadata
7674
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder, assign_fresh_sort_order_ids
75+
from pyiceberg.table.update import (
76+
TableRequirement,
77+
TableUpdate,
78+
)
7779
from pyiceberg.typedef import EMPTY_DICT, UTF8, IcebergBaseModel, Identifier, Properties
7880
from pyiceberg.types import transform_dict_value_to_str
7981
from pyiceberg.utils.deprecated import deprecation_message

pyiceberg/catalog/sql.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,13 @@
6161
from pyiceberg.partitioning import UNPARTITIONED_PARTITION_SPEC, PartitionSpec
6262
from pyiceberg.schema import Schema
6363
from pyiceberg.serializers import FromInputFile
64-
from pyiceberg.table import CommitTableResponse, Table, TableRequirement, TableUpdate
64+
from pyiceberg.table import CommitTableResponse, Table
6565
from pyiceberg.table.metadata import new_table_metadata
6666
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
67+
from pyiceberg.table.update import (
68+
TableRequirement,
69+
TableUpdate,
70+
)
6771
from pyiceberg.typedef import EMPTY_DICT, Identifier, Properties
6872
from pyiceberg.types import strtobool
6973

0 commit comments

Comments
 (0)