Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
emgeee committed Sep 10, 2024
1 parent afcc9f1 commit 7f6187a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
18 changes: 10 additions & 8 deletions python/datafusion/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@

from __future__ import annotations

from ._internal import (
expr as expr_internal,
LogicalPlan,
functions as functions_internal,
)
from datafusion.common import NullTreatment, RexType, DataTypeMap
from typing import Any, Optional, Type
from typing_extensions import deprecated

import pyarrow as pa
from datafusion.common import DataTypeMap, NullTreatment, RexType
from typing_extensions import deprecated

from ._internal import LogicalPlan
from ._internal import expr as expr_internal
from ._internal import functions as functions_internal

# The following are imported from the internal representation. We may choose to
# give these all proper wrappers, or to simply leave as is. These were added
Expand Down Expand Up @@ -196,7 +196,9 @@ def to_variant(self) -> Any:
"""Convert this expression into a python object if possible."""
return self.expr.to_variant()

@deprecated("display_name() is deprecated. Use :py:meth:`~Expr.schema_name` instead")
@deprecated(
"display_name() is deprecated. Use :py:meth:`~Expr.schema_name` instead"
)
def display_name(self) -> str:
"""Returns the name of this expression as it should appear in a schema.
Expand Down
14 changes: 9 additions & 5 deletions python/datafusion/tests/test_expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@
# specific language governing permissions and limitations
# under the License.

import pyarrow
import pytest
from datafusion import SessionContext, col
from datafusion.expr import Column, Literal, BinaryExpr, AggregateFunction
from datafusion.expr import (
Projection,
Filter,
Aggregate,
AggregateFunction,
BinaryExpr,
Column,
Filter,
Limit,
Literal,
Projection,
Sort,
TableScan,
)
import pyarrow
import pytest


@pytest.fixture
Expand Down Expand Up @@ -196,6 +199,7 @@ def test_expr_getitem() -> None:

def test_display_name_deprecation():
import warnings

expr = col("foo")
with warnings.catch_warnings(record=True) as w:
# Cause all warnings to always be triggered
Expand Down

0 comments on commit 7f6187a

Please sign in to comment.