Skip to content

Commit b3f498f

Browse files
committed
Add deprecated marker from either typing or typing_extensions based on the python version
1 parent 8082ac6 commit b3f498f

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

python/datafusion/context.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121

2222
from typing import TYPE_CHECKING, Any, Protocol
2323

24-
from typing_extensions import deprecated
24+
try:
25+
from typing import deprecated # Python 3.13+
26+
except ImportError:
27+
from typing_extensions import deprecated # Python 3.12
2528

2629
from datafusion.catalog import Catalog, Table
2730
from datafusion.dataframe import DataFrame

python/datafusion/dataframe.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
overload,
3434
)
3535

36-
from typing_extensions import deprecated
36+
try:
37+
from typing import deprecated # Python 3.13+
38+
except ImportError:
39+
from typing_extensions import deprecated # Python 3.12
3740

3841
from datafusion.plan import ExecutionPlan, LogicalPlan
3942
from datafusion.record_batch import RecordBatchStream

python/datafusion/expr.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
from typing import TYPE_CHECKING, Any, Optional, Type
2626

2727
import pyarrow as pa
28-
from typing_extensions import deprecated
28+
29+
try:
30+
from typing import deprecated # Python 3.13+
31+
except ImportError:
32+
from typing_extensions import deprecated # Python 3.12
2933

3034
from datafusion.common import DataTypeMap, NullTreatment, RexType
3135

python/datafusion/substrait.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
import pathlib
2727
from typing import TYPE_CHECKING
2828

29-
from typing_extensions import deprecated
29+
try:
30+
from typing import deprecated # Python 3.13+
31+
except ImportError:
32+
from typing_extensions import deprecated # Python 3.12
3033

3134
from datafusion.plan import LogicalPlan
3235

0 commit comments

Comments
 (0)