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

FIX-#7143: Constructing a DataFrame from a Modin Series with tuple name should produce MultiIndex columns #7214

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

noloerino
Copy link
Collaborator

@noloerino noloerino commented Apr 23, 2024

What do these changes do?

Fixes a bug where creating a DF from a Series with tuple name did not give the DF a MultiIndex object for its columns property. This PR sets the underlying query compiler's object to be a MultiIndex when the Series is created.

  • first commit message and PR title follow format outlined here

    NOTE: If you edit the PR title to match this format, you need to add another commit (even if it's empty) or amend your last commit for the CI job that checks the PR title to pick up the new PR title.

  • passes flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
  • passes black --check modin/ asv_bench/benchmarks scripts/doc_checker.py
  • signed commit with git commit -s
  • Resolves BUG: Constructing a DataFrame from a Modin Series with tuple name should produce MultiIndex columns #7143
  • tests added and passing
  • module layout described at docs/development/architecture.rst is up-to-date

@noloerino noloerino marked this pull request as ready for review April 23, 2024 22:56
def test_df_from_series_with_tuple_name():
# Tests that creating a DataFrame from a series with a tuple name results in
# a DataFrame with MultiIndex columns.
pd.testing.assert_index_equal(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @noloerino! Overall it looks good! However, it may be more reliable to check the entire objects themselves, and not just the index (for example, using eval_general). What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I didn't add eval_general since this is testing the DF constructor and not any methods on top of it, but I changed it to use df_equals instead.

Copy link
Collaborator

@anmyachev anmyachev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @noloerino!

@anmyachev
Copy link
Collaborator

@noloerino please also sign your commits with git commit -s.

…with tuple name should produce MultiIndex columns

Signed-off-by: Jonathan Shi <[email protected]>
@sfc-gh-joshi
Copy link

Should be fixed now, thanks.

@anmyachev anmyachev merged commit 199e3fd into modin-project:main Apr 25, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Constructing a DataFrame from a Modin Series with tuple name should produce MultiIndex columns
3 participants