Skip to content

Commit

Permalink
Move from types_extensions to types (#1586)
Browse files Browse the repository at this point in the history
`Annotated` has been part of `typing` since 3.9
  • Loading branch information
Fokko authored Jan 28, 2025
1 parent 1ce43dd commit 1adbb87
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 35 deletions.
12 changes: 1 addition & 11 deletions pyiceberg/partitioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,7 @@
from dataclasses import dataclass
from datetime import date, datetime, time
from functools import cached_property, singledispatch
from typing import (
Any,
Dict,
Generic,
List,
Optional,
Tuple,
TypeVar,
Union,
)
from typing import Annotated, Any, Dict, Generic, List, Optional, Tuple, TypeVar, Union
from urllib.parse import quote_plus

from pydantic import (
Expand All @@ -40,7 +31,6 @@
WithJsonSchema,
model_validator,
)
from typing_extensions import Annotated

from pyiceberg.schema import Schema
from pyiceberg.transforms import (
Expand Down
10 changes: 1 addition & 9 deletions pyiceberg/table/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,10 @@
import datetime
import uuid
from copy import copy
from typing import (
Any,
Dict,
List,
Literal,
Optional,
Union,
)
from typing import Annotated, Any, Dict, List, Literal, Optional, Union

from pydantic import Field, field_serializer, field_validator, model_validator
from pydantic import ValidationError as PydanticValidationError
from typing_extensions import Annotated

from pyiceberg.exceptions import ValidationError
from pyiceberg.partitioning import PARTITION_FIELD_ID_START, PartitionSpec, assign_fresh_partition_spec_ids
Expand Down
3 changes: 1 addition & 2 deletions pyiceberg/table/refs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
# specific language governing permissions and limitations
# under the License.
from enum import Enum
from typing import Optional
from typing import Annotated, Optional

from pydantic import Field, model_validator
from typing_extensions import Annotated

from pyiceberg.exceptions import ValidationError
from pyiceberg.typedef import IcebergBaseModel
Expand Down
10 changes: 1 addition & 9 deletions pyiceberg/table/sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@
# under the License.
# pylint: disable=keyword-arg-before-vararg
from enum import Enum
from typing import (
Any,
Callable,
Dict,
List,
Optional,
Union,
)
from typing import Annotated, Any, Callable, Dict, List, Optional, Union

from pydantic import (
BeforeValidator,
Expand All @@ -32,7 +25,6 @@
WithJsonSchema,
model_validator,
)
from typing_extensions import Annotated

from pyiceberg.schema import Schema
from pyiceberg.transforms import IdentityTransform, Transform, parse_transform
Expand Down
3 changes: 1 addition & 2 deletions pyiceberg/table/update/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
from abc import ABC, abstractmethod
from datetime import datetime
from functools import singledispatch
from typing import TYPE_CHECKING, Any, Dict, Generic, List, Literal, Optional, Tuple, TypeVar, Union, cast
from typing import TYPE_CHECKING, Annotated, Any, Dict, Generic, List, Literal, Optional, Tuple, TypeVar, Union, cast

from pydantic import Field, field_validator, model_validator
from typing_extensions import Annotated

from pyiceberg.exceptions import CommitFailedException
from pyiceberg.partitioning import PARTITION_FIELD_ID_START, PartitionSpec
Expand Down
3 changes: 1 addition & 2 deletions tests/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# pylint: disable=eval-used,protected-access,redefined-outer-name
from datetime import date
from decimal import Decimal
from typing import Any, Callable, Optional, Union
from typing import Annotated, Any, Callable, Optional, Union
from uuid import UUID

import mmh3 as mmh3
Expand All @@ -30,7 +30,6 @@
RootModel,
WithJsonSchema,
)
from typing_extensions import Annotated

from pyiceberg.expressions import (
AlwaysFalse,
Expand Down

0 comments on commit 1adbb87

Please sign in to comment.