Skip to content

Commit

Permalink
Doc updates
Browse files Browse the repository at this point in the history
Signed-off-by: arunjose696 <arunjose696@gmail.com>
  • Loading branch information
arunjose696 committed Aug 26, 2024
1 parent 60f9512 commit 80ce01c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,6 @@ jobs:
- run: python -m pytest modin/tests/pandas/native_df_mode/test_join_sort.py
- run: python -m pytest modin/tests/pandas/native_df_mode/test_map_metadata.py
- run: python -m pytest modin/tests/pandas/native_df_mode/test_pickle.py
- run: python -m pytest modin/tests/pandas/native_df_mode/test_reduce.py
- run: python -m pytest modin/tests/pandas/native_df_mode/test_udf.py
- run: python -m pytest modin/tests/pandas/native_df_mode/test_window.py
- uses: ./.github/actions/upload-coverage

Expand Down
29 changes: 24 additions & 5 deletions modin/core/storage_formats/pandas/query_compiler_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@


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

@classmethod
def __init_subclass__(
Expand All @@ -44,12 +41,34 @@ def __init_subclass__(
"""
Apply type casting to all children of ``QueryCompilerCaster``.
This method is called automatically when a class inherits from
``QueryCompilerCaster``. It ensures that all member functions within the
subclass have their arguments automatically casted to the current query
compiler type.
Parameters
----------
**kwargs : Additional keyword arguments
"""
super().__init_subclass__(**kwargs)
apply_argument_cast()(cls)


def cast_nested_args_to_current_qc_type(arguments, current_qc):
"""
Cast all arguments in nested fashion to current query compiler.
Parameters
----------
arguments : tuple or dict
current_qc : BaseQueryCompiler
Returns
-------
tuple or dict
Returns args and kwargs with all query compilers casted to current_qc.
"""

def cast_arg_to_current_qc(arg):
current_qc_type = type(current_qc)
if isinstance(arg, BaseQueryCompiler) and not isinstance(arg, current_qc_type):
Expand Down Expand Up @@ -91,7 +110,7 @@ def apply_argument_cast():
"""

def decorator(obj: Fn) -> Fn:
"""Decorate function or class to cast all arguments that are query compilers to the current query compiler"""
"""Cast all arguments that are query compilers to the current query compiler."""
if isinstance(obj, type):
all_attrs = dict(inspect.getmembers(obj))
all_attrs.pop("__abstractmethods__")
Expand Down
2 changes: 0 additions & 2 deletions modin/tests/pandas/native_df_mode/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ def test_set_index(data, key_func, drop_kwargs, request, data_frame_mode_pair):
"data_frame_mode_pair", list(product(NativeDataframeMode.choices, repeat=2))
)
def test_loc(data, data_frame_mode_pair):
modin_df = pd.DataFrame(data)
pandas_df = pandas.DataFrame(data)
modin_df, pandas_df = create_test_dfs(data, data_frame_mode=data_frame_mode_pair[0])

indices = [i % 3 == 0 for i in range(len(modin_df.index))]
Expand Down

0 comments on commit 80ce01c

Please sign in to comment.