Skip to content

Commit b415014

Browse files
committed
Fixed failing ruff tests
1 parent fc23741 commit b415014

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ ignore = [
8181
"UP007", # Disallowing Union is pedantic
8282
# TODO: Enable all of the following, but this PR is getting too large already
8383
"PLR0913",
84-
"SIM102",
8584
"TRY003",
8685
"PLR2004",
8786
"PD901",

python/datafusion/functions.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,10 +790,7 @@ def regexp_count(
790790
"""
791791
if flags is not None:
792792
flags = flags.expr
793-
if start is not None:
794-
start = start.expr
795-
else:
796-
start = Expr.expr
793+
start = start.expr if start is not None else Expr.expr
797794
return Expr(f.regexp_count(string.expr, pattern.expr, start, flags))
798795

799796

python/tests/test_wrapper_coverage.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from enum import EnumMeta as EnumType
2929

3030

31-
def missing_exports(internal_obj, wrapped_obj) -> None: # noqa: C901
31+
def missing_exports(internal_obj, wrapped_obj) -> None:
3232
"""
3333
Identify if any of the rust exposted structs or functions do not have wrappers.
3434
@@ -56,9 +56,8 @@ def missing_exports(internal_obj, wrapped_obj) -> None: # noqa: C901
5656
# __kwdefaults__ and __doc__. As long as these are None on the internal
5757
# object, it's okay to skip them. However if they do exist on the internal
5858
# object they must also exist on the wrapped object.
59-
if internal_attr is not None:
60-
if wrapped_attr is None:
61-
pytest.fail(f"Missing attribute: {internal_attr_name}")
59+
if internal_attr is not None and wrapped_attr is None:
60+
pytest.fail(f"Missing attribute: {internal_attr_name}")
6261

6362
if internal_attr_name in ["__self__", "__class__"]:
6463
continue

0 commit comments

Comments
 (0)