Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Iaroslav Igoshev <Poolliver868@mail.ru>
Co-authored-by: Anatoly Myachev <anatoliimyachev@mail.com>
  • Loading branch information
3 people authored Aug 28, 2024
1 parent 6a068dc commit cac89d2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions modin/core/storage_formats/pandas/query_compiler_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
arguments to the type of the current query compiler for query compiler class functions.
This ensures compatibility between different query compiler classes.
"""

import functools
import inspect
from types import FunctionType, MethodType
Expand All @@ -31,7 +32,7 @@


class QueryCompilerCaster:
"""Cast all query compiler arguments of a the member function to current query compiler."""
"""Cast all query compiler arguments of the member function to current query compiler."""

@classmethod
def __init_subclass__(
Expand Down Expand Up @@ -149,11 +150,8 @@ def cast_args(*args: Tuple, **kwargs: Dict) -> Any:
-------
Any
"""
current_qc = None
if isinstance(args[0], BaseQueryCompiler):
current_qc = args[0]

if current_qc:
current_qc = args[0]
if isinstance(current_qc, BaseQueryCompiler):
kwargs = cast_nested_args_to_current_qc_type(kwargs, current_qc)
args = cast_nested_args_to_current_qc_type(args, current_qc)
return obj(*args, **kwargs)
Expand Down

0 comments on commit cac89d2

Please sign in to comment.