You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by ti...@apache.org on 2025/02/16 12:59:22 UTC
(datafusion-python) 02/03: Add deprecated marker from either typing or typing_extensions based on the python version
This is an automated email from the ASF dual-hosted git repository.
timsaucer pushed a commit to tag 45.0.0-rc2
in repository https://gitbox.apache.org/repos/asf/datafusion-python.git
commit b3f498f233771625bcc7793c526958b5f592698a
Author: Tim Saucer <ti...@gmail.com>
AuthorDate: Sun Feb 16 07:48:20 2025 -0500
Add deprecated marker from either typing or typing_extensions based on the python version
---
python/datafusion/context.py | 5 ++++-
python/datafusion/dataframe.py | 5 ++++-
python/datafusion/expr.py | 6 +++++-
python/datafusion/substrait.py | 5 ++++-
4 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/python/datafusion/context.py b/python/datafusion/context.py
index 864ef1c8..c651f90a 100644
--- a/python/datafusion/context.py
+++ b/python/datafusion/context.py
@@ -21,7 +21,10 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, Protocol
-from typing_extensions import deprecated
+try:
+ from typing import deprecated # Python 3.13+
+except ImportError:
+ from typing_extensions import deprecated # Python 3.12
from datafusion.catalog import Catalog, Table
from datafusion.dataframe import DataFrame
diff --git a/python/datafusion/dataframe.py b/python/datafusion/dataframe.py
index 7413a5fa..21b82b1a 100644
--- a/python/datafusion/dataframe.py
+++ b/python/datafusion/dataframe.py
@@ -33,7 +33,10 @@ from typing import (
overload,
)
-from typing_extensions import deprecated
+try:
+ from typing import deprecated # Python 3.13+
+except ImportError:
+ from typing_extensions import deprecated # Python 3.12
from datafusion.plan import ExecutionPlan, LogicalPlan
from datafusion.record_batch import RecordBatchStream
diff --git a/python/datafusion/expr.py b/python/datafusion/expr.py
index 68ddd7c9..dcafa42f 100644
--- a/python/datafusion/expr.py
+++ b/python/datafusion/expr.py
@@ -25,7 +25,11 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional, Type
import pyarrow as pa
-from typing_extensions import deprecated
+
+try:
+ from typing import deprecated # Python 3.13+
+except ImportError:
+ from typing_extensions import deprecated # Python 3.12
from datafusion.common import DataTypeMap, NullTreatment, RexType
diff --git a/python/datafusion/substrait.py b/python/datafusion/substrait.py
index 402184d3..4553d238 100644
--- a/python/datafusion/substrait.py
+++ b/python/datafusion/substrait.py
@@ -26,7 +26,10 @@ from __future__ import annotations
import pathlib
from typing import TYPE_CHECKING
-from typing_extensions import deprecated
+try:
+ from typing import deprecated # Python 3.13+
+except ImportError:
+ from typing_extensions import deprecated # Python 3.12
from datafusion.plan import LogicalPlan
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org