Skip to content

Commit

Permalink
expand comments
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed May 14, 2024
1 parent 3213194 commit 45acef9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions modin/core/dataframe/pandas/dataframe/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -3985,6 +3985,7 @@ def _compute_new_widths():
new_columns = joined_index
frames = [self] + others
# TODO: should we wrap all `concat` call into "try except" block?
# `ModinDtypes.concat` can throw exception in case of duplicate values
new_dtypes = ModinDtypes.concat([frame._dtypes for frame in frames], axis=1)
# If we have already cached the length of each row in at least one
# of the row's partitions, we can build new_lengths for the new
Expand Down Expand Up @@ -4621,6 +4622,9 @@ def _arrow_type_to_dtype(cls, arrow_type):

try:
# TODO: should we map arrow types to pyarrow-backed pandas types?
# It seems like this might help avoid the expense of transferring
# data between backends (numpy and pyarrow), but we need to be sure
# how this fits into the type inference system in pandas.
res = arrow_type.to_pandas_dtype()
# Conversion to pandas is not implemented for some arrow types,
# perform manual conversion for them:
Expand Down
1 change: 1 addition & 0 deletions modin/core/storage_formats/pandas/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ def applyier(df, other): # pragma: no cover
# different partitions
if len(index) == 0 and len(columns) > 0:
common_type = find_common_type(result.dtypes.tolist())
# TODO: remove find_common_type+astype after pandas fix the following issue
# transpose loses dtypes: https://github.com/pandas-dev/pandas/issues/43337
result = result.transpose().astype(common_type, copy=False)

Expand Down
2 changes: 1 addition & 1 deletion modin/tests/pandas/dataframe/test_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_math_functions(other, axis, op, backend):
pytest.xfail(reason="different behavior")

if op in ("mod", "rmod") and backend == "pyarrow":
pytest.skip(reason="Not implemented for pyarrow backend")
pytest.skip(reason="These functions are not implemented in pandas itself")
eval_general(
*create_test_dfs(data, backend=backend),
lambda df: getattr(df, op)(other(df, axis), axis=axis),
Expand Down

0 comments on commit 45acef9

Please sign in to comment.