Skip to content

Conversation

@timsaucer
Copy link
Member

Which issue does this PR close?

None

Rationale for this change

During a recent push #1052 , we discovered the need to enable additional ruff checks to catch errors in the repo before they get merged into main. This PR enables many more ruff checks and creates a list of those we still should address or choose to ignore.

What changes are included in this PR?

ALMOST all of the changes are slight formatting. There are some changes to udaf and udf decorator/functions.

Are there any user-facing changes?

These should be transparent to the user.

@timsaucer
Copy link
Member Author

@CrystalZhou0529 would you mind reviewing the changes I made to udf and udaf?

@timsaucer timsaucer force-pushed the feat/greater-ruff-coverage branch from 5bbb822 to 5f3f7c7 Compare March 10, 2025 11:42
@timsaucer
Copy link
Member Author

#1056 contains the follow on work to apply additional rules

Comment on lines +114 to +131
@overload
@staticmethod
def udf(
input_types: list[pa.DataType],
return_type: _R,
volatility: Volatility | str,
name: Optional[str] = None,
) -> Callable[..., ScalarUDF]: ...

@overload
@staticmethod
def udf(
func: Callable[..., _R],
input_types: list[pa.DataType],
return_type: _R,
volatility: Volatility | str,
name: Optional[str] = None,
) -> ScalarUDF: ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sharing this with me! I wasn't aware of this way to overload a function in Python but this is so much cleaner than the previous version. I really appreciate your effort here.

Copy link
Contributor

@ion-elgreco ion-elgreco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! :)

Copy link
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

might be a good idea to split out the python version bump into a seperate PR

readme = "README.md"
license = { file = "LICENSE.txt" }
requires-python = ">=3.8"
requires-python = ">=3.9"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we split out this python version bump?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why the diff doesn't show, but that's already merged into main


[[package]]
name = "datafusion"
version = "44.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i cant find any reasons why this was removed

@timsaucer timsaucer merged commit b194a87 into apache:main Mar 12, 2025
17 checks passed
@timsaucer timsaucer deleted the feat/greater-ruff-coverage branch March 12, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants