Skip to content

Commit 5ac0982

Browse files
committed
refactor: update SortKey type definition to use union operator and move declaration
1 parent f313444 commit 5ac0982

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

python/datafusion/expr.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from __future__ import annotations
2424

25-
from typing import TYPE_CHECKING, Any, ClassVar, Optional, Sequence, Union
25+
from typing import TYPE_CHECKING, Any, ClassVar, Optional, Sequence
2626

2727
import pyarrow as pa
2828

@@ -43,8 +43,6 @@
4343
# Standard error message for invalid expression types
4444
EXPR_TYPE_ERROR = "Use col() or lit() to construct expressions"
4545

46-
SortKey = Union["Expr", "SortExpr", str]
47-
4846
# The following are imported from the internal representation. We may choose to
4947
# give these all proper wrappers, or to simply leave as is. These were added
5048
# in order to support passing the `test_imports` unit test.
@@ -1340,3 +1338,6 @@ def nulls_first(self) -> bool:
13401338
def __repr__(self) -> str:
13411339
"""Generate a string representation of this expression."""
13421340
return self.raw_sort.__repr__()
1341+
1342+
1343+
SortKey = Expr | SortExpr | str

0 commit comments

Comments
 (0)