Skip to content

Commit 1adbb87

Browse files
authored
Move from types_extensions to types (#1586)
`Annotated` has been part of `typing` since 3.9
1 parent 1ce43dd commit 1adbb87

File tree

6 files changed

+6
-35
lines changed

6 files changed

+6
-35
lines changed

pyiceberg/partitioning.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,7 @@
2121
from dataclasses import dataclass
2222
from datetime import date, datetime, time
2323
from functools import cached_property, singledispatch
24-
from typing import (
25-
Any,
26-
Dict,
27-
Generic,
28-
List,
29-
Optional,
30-
Tuple,
31-
TypeVar,
32-
Union,
33-
)
24+
from typing import Annotated, Any, Dict, Generic, List, Optional, Tuple, TypeVar, Union
3425
from urllib.parse import quote_plus
3526

3627
from pydantic import (
@@ -40,7 +31,6 @@
4031
WithJsonSchema,
4132
model_validator,
4233
)
43-
from typing_extensions import Annotated
4434

4535
from pyiceberg.schema import Schema
4636
from pyiceberg.transforms import (

pyiceberg/table/metadata.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,10 @@
1919
import datetime
2020
import uuid
2121
from copy import copy
22-
from typing import (
23-
Any,
24-
Dict,
25-
List,
26-
Literal,
27-
Optional,
28-
Union,
29-
)
22+
from typing import Annotated, Any, Dict, List, Literal, Optional, Union
3023

3124
from pydantic import Field, field_serializer, field_validator, model_validator
3225
from pydantic import ValidationError as PydanticValidationError
33-
from typing_extensions import Annotated
3426

3527
from pyiceberg.exceptions import ValidationError
3628
from pyiceberg.partitioning import PARTITION_FIELD_ID_START, PartitionSpec, assign_fresh_partition_spec_ids

pyiceberg/table/refs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
from enum import Enum
18-
from typing import Optional
18+
from typing import Annotated, Optional
1919

2020
from pydantic import Field, model_validator
21-
from typing_extensions import Annotated
2221

2322
from pyiceberg.exceptions import ValidationError
2423
from pyiceberg.typedef import IcebergBaseModel

pyiceberg/table/sorting.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,7 @@
1616
# under the License.
1717
# pylint: disable=keyword-arg-before-vararg
1818
from enum import Enum
19-
from typing import (
20-
Any,
21-
Callable,
22-
Dict,
23-
List,
24-
Optional,
25-
Union,
26-
)
19+
from typing import Annotated, Any, Callable, Dict, List, Optional, Union
2720

2821
from pydantic import (
2922
BeforeValidator,
@@ -32,7 +25,6 @@
3225
WithJsonSchema,
3326
model_validator,
3427
)
35-
from typing_extensions import Annotated
3628

3729
from pyiceberg.schema import Schema
3830
from pyiceberg.transforms import IdentityTransform, Transform, parse_transform

pyiceberg/table/update/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@
2020
from abc import ABC, abstractmethod
2121
from datetime import datetime
2222
from functools import singledispatch
23-
from typing import TYPE_CHECKING, Any, Dict, Generic, List, Literal, Optional, Tuple, TypeVar, Union, cast
23+
from typing import TYPE_CHECKING, Annotated, Any, Dict, Generic, List, Literal, Optional, Tuple, TypeVar, Union, cast
2424

2525
from pydantic import Field, field_validator, model_validator
26-
from typing_extensions import Annotated
2726

2827
from pyiceberg.exceptions import CommitFailedException
2928
from pyiceberg.partitioning import PARTITION_FIELD_ID_START, PartitionSpec

tests/test_transforms.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# pylint: disable=eval-used,protected-access,redefined-outer-name
1919
from datetime import date
2020
from decimal import Decimal
21-
from typing import Any, Callable, Optional, Union
21+
from typing import Annotated, Any, Callable, Optional, Union
2222
from uuid import UUID
2323

2424
import mmh3 as mmh3
@@ -30,7 +30,6 @@
3030
RootModel,
3131
WithJsonSchema,
3232
)
33-
from typing_extensions import Annotated
3433

3534
from pyiceberg.expressions import (
3635
AlwaysFalse,

0 commit comments

Comments
 (0)