Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Appending string to column returns in different order #4907

Closed
pyrito opened this issue Aug 31, 2022 · 1 comment · Fixed by #4908
Closed

BUG: Appending string to column returns in different order #4907

pyrito opened this issue Aug 31, 2022 · 1 comment · Fixed by #4908
Assignees
Labels
bug 🦗 Something isn't working P1 Important tasks that we should complete soon pandas concordance 🐼 Functionality that does not match pandas

Comments

@pyrito
Copy link
Collaborator

pyrito commented Aug 31, 2022

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS 12.2.1
  • Modin version (modin.__version__): 0.15.0+101.g14edd1ca
  • Python version: 3.9.12
  • Code we can use to reproduce:
import modin.pandas as pd
import pandas
from modin.pandas.test.utils import df_equals

pdf = pandas.DataFrame({'a' : ['a','b','c','d']})
mdf = pd.DataFrame({'a' : ['a','b','c','d']})

pdf['a'] = 'random_string' + pdf['a']
mdf['a'] = 'random_string' + mdf['a']

df_equals(pdf, mdf)

Describe the problem

Appending a string to a str column in a Modin DataFrame returns values in a different order.

Source code / logs

Error logs
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
Input In [18], in <cell line: 11>()
      8 pdf['a'] = 'random_string' + pdf['a']
      9 mdf['a'] = 'random_string' + mdf['a']
---> 11 df_equals(pdf, mdf)

File ~/Documents/modin/modin/pandas/test/utils.py:589, in df_equals(df1, df2)
    586     assert_empty_frame_equal(df1, df2)
    588 if isinstance(df1, pandas.DataFrame) and isinstance(df2, pandas.DataFrame):
--> 589     assert_frame_equal(
    590         df1,
    591         df2,
    592         check_dtype=False,
    593         check_datetimelike_compat=True,
    594         check_index_type=False,
    595         check_column_type=False,
    596         check_categorical=False,
    597     )
    598     df_categories_equals(df1, df2)
    599 elif isinstance(df1, pandas.Index) and isinstance(df2, pandas.Index):

    [... skipping hidden 2 frame]

File ~/opt/anaconda3/envs/modin/lib/python3.9/site-packages/pandas/_libs/testing.pyx:52, in pandas._libs.testing.assert_almost_equal()

File ~/opt/anaconda3/envs/modin/lib/python3.9/site-packages/pandas/_libs/testing.pyx:167, in pandas._libs.testing.assert_almost_equal()

File ~/opt/anaconda3/envs/modin/lib/python3.9/site-packages/pandas/_testing/asserters.py:682, in raise_assert_detail(obj, message, left, right, diff, index_values)
    679 if diff is not None:
    680     msg += f"\n[diff]: {diff}"
--> 682 raise AssertionError(msg)

AssertionError: DataFrame.iloc[:, 0] (column name="a") are different

DataFrame.iloc[:, 0] (column name="a") values are different (100.0 %)
[index]: [0, 1, 2, 3]
[left]:  [random_stringa, random_stringb, random_stringc, random_stringd]
[right]: [arandom_string, brandom_string, crandom_string, drandom_string]
@pyrito pyrito added bug 🦗 Something isn't working pandas concordance 🐼 Functionality that does not match pandas P1 Important tasks that we should complete soon labels Aug 31, 2022
@pyrito
Copy link
Collaborator Author

pyrito commented Aug 31, 2022

The problem here is that radd is just an alias for add so we don't actually consider the position of arguments. We'll have to make some changes to handle this case.

@pyrito pyrito self-assigned this Aug 31, 2022
pyrito pushed a commit to pyrito/modin that referenced this issue Aug 31, 2022
Signed-off-by: Karthik Velayutham <vkarthik@ponder.io>
YarShev pushed a commit that referenced this issue Sep 1, 2022
Signed-off-by: Karthik Velayutham <vkarthik@ponder.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🦗 Something isn't working P1 Important tasks that we should complete soon pandas concordance 🐼 Functionality that does not match pandas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant