File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727from collections .abc import Iterable , Sequence
2828from typing import TYPE_CHECKING , Any , ClassVar
2929
30- try :
31- from warnings import deprecated # Python 3.13+
32- except ImportError :
33- from typing_extensions import deprecated # Python 3.12
34-
3530import pyarrow as pa
3631
3732from ._internal import expr as expr_internal
@@ -356,16 +351,6 @@ def to_variant(self) -> Any:
356351 """Convert this expression into a python object if possible."""
357352 return self .expr .to_variant ()
358353
359- @deprecated (
360- "display_name() is deprecated. Use :py:meth:`~Expr.schema_name` instead"
361- )
362- def display_name (self ) -> str :
363- """Returns the name of this expression as it should appear in a schema.
364-
365- This name will not include any CAST expressions.
366- """
367- return self .schema_name ()
368-
369354 def schema_name (self ) -> str :
370355 """Returns the name of this expression as it should appear in a schema.
371356
Original file line number Diff line number Diff line change @@ -319,27 +319,6 @@ def test_expr_getitem() -> None:
319319 assert array_values == [2 , 5 , None , None ]
320320
321321
322- def test_display_name_deprecation ():
323- import warnings
324-
325- expr = col ("foo" )
326- with warnings .catch_warnings (record = True ) as w :
327- # Cause all warnings to always be triggered
328- warnings .simplefilter ("always" )
329-
330- # should trigger warning
331- name = expr .display_name ()
332-
333- # Verify some things
334- assert len (w ) == 1
335- assert issubclass (w [- 1 ].category , DeprecationWarning )
336- assert "deprecated" in str (w [- 1 ].message )
337-
338- # returns appropriate result
339- assert name == expr .schema_name ()
340- assert name == "foo"
341-
342-
343322@pytest .fixture
344323def df ():
345324 ctx = SessionContext ()
You can’t perform that action at this time.
0 commit comments