Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pyiceberg/avro/codecs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@

from __future__ import annotations

from typing import Literal

from typing_extensions import TypeAlias
from typing import Literal, TypeAlias

from pyiceberg.avro.codecs.bzip2 import BZip2Codec
from pyiceberg.avro.codecs.codec import Codec
Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/avro/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
import io
import json
import os
from collections.abc import Callable
from dataclasses import dataclass
from enum import Enum
from types import TracebackType
from typing import (
Callable,
Generic,
TypeVar,
)
Expand Down
3 changes: 1 addition & 2 deletions pyiceberg/avro/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@
from __future__ import annotations

from abc import abstractmethod
from collections.abc import Callable, Mapping
from dataclasses import dataclass
from dataclasses import field as dataclassfield
from decimal import Decimal
from typing import (
Any,
Callable,
Mapping,
)
from uuid import UUID

Expand Down
4 changes: 1 addition & 3 deletions pyiceberg/avro/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
# specific language governing permissions and limitations
# under the License.
# pylint: disable=arguments-renamed,unused-argument
from collections.abc import Callable
from enum import Enum
from typing import (
Callable,
)

from pyiceberg.avro.decoder import BinaryDecoder
from pyiceberg.avro.reader import (
Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/catalog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
import re
import uuid
from abc import ABC, abstractmethod
from collections.abc import Callable
from dataclasses import dataclass
from enum import Enum
from typing import (
TYPE_CHECKING,
Any,
Callable,
cast,
)

Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/cli/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
# specific language governing permissions and limitations
# under the License.
# pylint: disable=broad-except,redefined-builtin,redefined-outer-name
from collections.abc import Callable
from functools import wraps
from typing import (
Any,
Callable,
Literal,
)

Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@

import codecs
import uuid
from collections.abc import Callable
from datetime import date, datetime, time
from decimal import Decimal
from functools import singledispatch
from struct import Struct
from typing import (
Any,
Callable,
)

from pyiceberg.typedef import UTF8, L
Expand Down
3 changes: 2 additions & 1 deletion pyiceberg/expressions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@

import builtins
from abc import ABC, abstractmethod
from collections.abc import Callable, Iterable, Sequence
from functools import cached_property
from typing import TYPE_CHECKING, Any, Callable, Iterable, Sequence, cast
from typing import TYPE_CHECKING, Any, cast
from typing import Literal as TypingLiteral

from pydantic import ConfigDict, Field
Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/expressions/visitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
# under the License.
import math
from abc import ABC, abstractmethod
from collections.abc import Callable
from functools import singledispatch
from typing import (
Any,
Callable,
Generic,
SupportsFloat,
TypeVar,
Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/io/fsspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
import logging
import os
import threading
from collections.abc import Callable
from copy import copy
from functools import lru_cache
from typing import (
TYPE_CHECKING,
Any,
Callable,
)
from urllib.parse import urlparse

Expand Down
4 changes: 1 addition & 3 deletions pyiceberg/io/pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,15 @@
import uuid
import warnings
from abc import ABC, abstractmethod
from collections.abc import Callable, Iterable, Iterator
from copy import copy
from dataclasses import dataclass
from enum import Enum
from functools import lru_cache, singledispatch
from typing import (
TYPE_CHECKING,
Any,
Callable,
Generic,
Iterable,
Iterator,
TypeVar,
cast,
)
Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
import math
import threading
from abc import ABC, abstractmethod
from collections.abc import Iterator
from copy import copy
from enum import Enum
from types import TracebackType
from typing import (
Any,
Iterator,
Literal,
)

Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
import builtins
import itertools
from abc import ABC, abstractmethod
from collections.abc import Callable
from dataclasses import dataclass
from functools import cached_property, partial, singledispatch
from typing import (
TYPE_CHECKING,
Any,
Callable,
Generic,
Literal,
TypeVar,
Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import codecs
import gzip
from abc import ABC, abstractmethod
from typing import Callable
from collections.abc import Callable

from pyiceberg.io import InputFile, InputStream, OutputFile
from pyiceberg.table.metadata import TableMetadata, TableMetadataUtil
Expand Down
4 changes: 1 addition & 3 deletions pyiceberg/table/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@
import uuid
import warnings
from abc import ABC, abstractmethod
from collections.abc import Callable, Iterable, Iterator
from dataclasses import dataclass
from functools import cached_property
from itertools import chain
from types import TracebackType
from typing import (
TYPE_CHECKING,
Any,
Callable,
Iterable,
Iterator,
TypeVar,
)

Expand Down
3 changes: 2 additions & 1 deletion pyiceberg/table/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
from __future__ import annotations

import itertools
from collections.abc import Iterator
from datetime import datetime, timezone
from typing import TYPE_CHECKING, Any, Iterator
from typing import TYPE_CHECKING, Any

from pyiceberg.conversions import from_bytes
from pyiceberg.expressions import AlwaysTrue, BooleanExpression
Expand Down
3 changes: 2 additions & 1 deletion pyiceberg/table/name_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
import builtins
from abc import ABC, abstractmethod
from collections import ChainMap
from collections.abc import Iterator
from functools import cached_property, singledispatch
from typing import Any, Generic, Iterator, TypeVar
from typing import Any, Generic, TypeVar

from pydantic import Field, conlist, field_validator, model_serializer

Expand Down
3 changes: 2 additions & 1 deletion pyiceberg/table/snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
import time
import warnings
from collections import defaultdict
from collections.abc import Iterable, Mapping
from enum import Enum
from typing import TYPE_CHECKING, Any, Iterable, Mapping
from typing import TYPE_CHECKING, Any

from pydantic import Field, PrivateAttr, model_serializer

Expand Down
3 changes: 2 additions & 1 deletion pyiceberg/table/sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
# specific language governing permissions and limitations
# under the License.
# pylint: disable=keyword-arg-before-vararg
from collections.abc import Callable
from enum import Enum
from typing import Annotated, Any, Callable
from typing import Annotated, Any

from pydantic import (
BeforeValidator,
Expand Down
3 changes: 2 additions & 1 deletion pyiceberg/table/update/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
import uuid
from abc import abstractmethod
from collections import defaultdict
from collections.abc import Callable
from concurrent.futures import Future
from datetime import datetime
from functools import cached_property
from typing import TYPE_CHECKING, Callable, Generic
from typing import TYPE_CHECKING, Generic

from sortedcontainers import SortedList

Expand Down
2 changes: 1 addition & 1 deletion pyiceberg/table/update/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from typing import Iterator
from collections.abc import Iterator

from pyiceberg.exceptions import ValidationException
from pyiceberg.expressions import BooleanExpression
Expand Down
3 changes: 2 additions & 1 deletion pyiceberg/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
import struct
import types
from abc import ABC, abstractmethod
from collections.abc import Callable
from enum import IntEnum
from functools import singledispatch
from typing import TYPE_CHECKING, Any, Callable, Generic, Optional, TypeVar
from typing import TYPE_CHECKING, Any, Generic, Optional, TypeVar
from typing import Literal as LiteralType
from uuid import UUID

Expand Down
5 changes: 3 additions & 2 deletions pyiceberg/typedef.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,24 @@
from __future__ import annotations

from abc import abstractmethod
from collections.abc import Callable
from datetime import date, datetime, time
from decimal import Decimal
from typing import (
TYPE_CHECKING,
Any,
Callable,
Generic,
Literal,
Protocol,
TypeAlias,
TypeVar,
Union,
runtime_checkable,
)
from uuid import UUID

from pydantic import BaseModel, ConfigDict, RootModel
from typing_extensions import Self, TypeAlias
from typing_extensions import Self

if TYPE_CHECKING:
from pyiceberg.types import StructType
Expand Down
3 changes: 1 addition & 2 deletions pyiceberg/utils/bin_packing.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
# under the License.
from __future__ import annotations

from collections.abc import Callable, Iterable
from typing import (
Callable,
Generic,
Iterable,
TypeVar,
)

Expand Down
3 changes: 2 additions & 1 deletion pyiceberg/utils/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
# under the License.
import functools
import warnings
from typing import Any, Callable
from collections.abc import Callable
from typing import Any


def deprecated(deprecated_in: str, removed_in: str, help_message: str | None = None) -> Callable: # type: ignore
Expand Down
4 changes: 1 addition & 3 deletions pyiceberg/utils/lazydict.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
# specific language governing permissions and limitations
# under the License.

from collections.abc import Iterator, Mapping, Sequence
from typing import (
Iterator,
Mapping,
Sequence,
TypeVar,
cast,
)
Expand Down
3 changes: 1 addition & 2 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ select = [
"UP", # pyupgrade
]
ignore = [
"E501",
"UP035"
"E501"
]

# Allow autofix for all enabled rules (when `--fix`) is provided.
Expand Down
2 changes: 1 addition & 1 deletion tests/avro/test_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

import itertools
import struct
from collections.abc import Callable
from io import SEEK_SET
from types import TracebackType
from typing import Callable
from unittest.mock import MagicMock, patch

import pytest
Expand Down
2 changes: 1 addition & 1 deletion tests/avro/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
# pylint:disable=protected-access
import json
from typing import Callable
from collections.abc import Callable

import pytest

Expand Down
2 changes: 1 addition & 1 deletion tests/catalog/integration_test_dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.

from typing import Generator
from collections.abc import Generator

import boto3
import pytest
Expand Down
3 changes: 2 additions & 1 deletion tests/catalog/integration_test_glue.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
# under the License.

import time
from typing import Any, Generator
from collections.abc import Generator
from typing import Any
from uuid import uuid4

import boto3
Expand Down
Loading