Skip to content

Commit

Permalink
Decouple imports reported by mypy linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ndrluis committed Mar 12, 2024
1 parent a48a001 commit 65ae527
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 15 deletions.
3 changes: 2 additions & 1 deletion pyiceberg/avro/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
TypeVar,
)

from pyiceberg.avro.codecs import KNOWN_CODECS, Codec
from pyiceberg.avro.codecs import KNOWN_CODECS
from pyiceberg.avro.codecs.codec import Codec
from pyiceberg.avro.decoder import BinaryDecoder, new_decoder
from pyiceberg.avro.encoder import BinaryEncoder
from pyiceberg.avro.reader import Reader
Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/catalog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
CommitTableRequest,
CommitTableResponse,
Table,
TableMetadata,
)
from pyiceberg.table.metadata import TableMetadata
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
from pyiceberg.typedef import (
EMPTY_DICT,
Expand Down
4 changes: 1 addition & 3 deletions pyiceberg/catalog/dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
PREVIOUS_METADATA_LOCATION,
TABLE_TYPE,
Catalog,
Identifier,
Properties,
PropertiesUpdateSummary,
)
from pyiceberg.exceptions import (
Expand All @@ -56,7 +54,7 @@
from pyiceberg.table import CommitTableRequest, CommitTableResponse, Table
from pyiceberg.table.metadata import new_table_metadata
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder
from pyiceberg.typedef import EMPTY_DICT
from pyiceberg.typedef import EMPTY_DICT, Identifier, Properties

if TYPE_CHECKING:
import pyarrow as pa
Expand Down
4 changes: 1 addition & 3 deletions pyiceberg/catalog/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
URI,
WAREHOUSE_LOCATION,
Catalog,
Identifier,
Properties,
PropertiesUpdateSummary,
)
from pyiceberg.exceptions import (
Expand Down Expand Up @@ -68,7 +66,7 @@
)
from pyiceberg.table.metadata import TableMetadata
from pyiceberg.table.sorting import UNSORTED_SORT_ORDER, SortOrder, assign_fresh_sort_order_ids
from pyiceberg.typedef import EMPTY_DICT, UTF8, IcebergBaseModel
from pyiceberg.typedef import EMPTY_DICT, UTF8, IcebergBaseModel, Identifier, Properties
from pyiceberg.types import transform_dict_value_to_str

if TYPE_CHECKING:
Expand Down
3 changes: 2 additions & 1 deletion pyiceberg/cli/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@

from pyiceberg.partitioning import PartitionSpec
from pyiceberg.schema import Schema
from pyiceberg.table import Table, TableMetadata
from pyiceberg.table import Table
from pyiceberg.table.metadata import TableMetadata
from pyiceberg.table.refs import SnapshotRefType
from pyiceberg.typedef import IcebergBaseModel, Identifier, Properties

Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/io/pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
)
from sortedcontainers import SortedList

from pyiceberg.avro.resolver import ResolveError
from pyiceberg.conversions import to_bytes
from pyiceberg.exceptions import ResolveError
from pyiceberg.expressions import (
AlwaysTrue,
BooleanExpression,
Expand Down
3 changes: 1 addition & 2 deletions pyiceberg/table/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
from pyiceberg.partitioning import (
INITIAL_PARTITION_SPEC_ID,
PARTITION_FIELD_ID_START,
IdentityTransform,
PartitionField,
PartitionSpec,
_PartitionNameGenerator,
Expand Down Expand Up @@ -108,7 +107,7 @@
update_snapshot_summaries,
)
from pyiceberg.table.sorting import SortOrder
from pyiceberg.transforms import TimeTransform, Transform, VoidTransform
from pyiceberg.transforms import IdentityTransform, TimeTransform, Transform, VoidTransform
from pyiceberg.typedef import (
EMPTY_DICT,
IcebergBaseModel,
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ warn_unreachable = true
warn_unused_ignores = true
disallow_any_generics = true
disallow_untyped_defs = true
implicit_reexport = false

[[tool.mypy.overrides]]
module = "pyarrow.*"
Expand Down
2 changes: 1 addition & 1 deletion tests/avro/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from fastavro import reader, writer

import pyiceberg.avro.file as avro
from pyiceberg.avro.codecs import DeflateCodec
from pyiceberg.avro.codecs.deflate import DeflateCodec
from pyiceberg.avro.file import META_SCHEMA, AvroFileHeader
from pyiceberg.io.pyarrow import PyArrowFileIO
from pyiceberg.manifest import (
Expand Down
3 changes: 2 additions & 1 deletion tests/avro/test_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
StringReader,
StructReader,
)
from pyiceberg.avro.resolver import ResolveError, resolve_reader, resolve_writer
from pyiceberg.avro.resolver import resolve_reader, resolve_writer
from pyiceberg.avro.writer import (
BinaryWriter,
DefaultWriter,
Expand All @@ -44,6 +44,7 @@
StringWriter,
StructWriter,
)
from pyiceberg.exceptions import ResolveError
from pyiceberg.io.pyarrow import PyArrowFileIO
from pyiceberg.manifest import MANIFEST_ENTRY_SCHEMAS
from pyiceberg.schema import Schema
Expand Down
2 changes: 1 addition & 1 deletion tests/io/test_pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import pytest
from pyarrow.fs import FileType, LocalFileSystem

from pyiceberg.avro.resolver import ResolveError
from pyiceberg.catalog.noop import NoopCatalog
from pyiceberg.exceptions import ResolveError
from pyiceberg.expressions import (
AlwaysFalse,
AlwaysTrue,
Expand Down

0 comments on commit 65ae527

Please sign in to comment.