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

ERR: Raise ValueError when non-default index is given for orc format #51828

Merged
merged 4 commits into from
Mar 14, 2023

Conversation

phofl
Copy link
Member

@phofl phofl commented Mar 7, 2023

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

orc can't handle indexes right now (they are dropped), so we should raise like we did in feather

@phofl phofl added IO Parquet parquet, feather Arrow pyarrow functionality labels Mar 7, 2023
pandas/io/orc.py Outdated
# validate that we have only a default index
# raise on anything else as we don't serialize the index

if not df.index.equals(RangeIndex.from_range(range(len(df)))):
Copy link
Member

Choose a reason for hiding this comment

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

Might be clearer to use pandas.core.indexes.api.default_index

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

@mroeschke
Copy link
Member

orc can't handle indexes right now (they are dropped)

Just confirming, they are dropped without a warning/exception from pyarrow?

@phofl
Copy link
Member Author

phofl commented Mar 7, 2023

Yes they are just gone when roundtripping

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

Merge conflict too otherwise looks good

phofl and others added 2 commits March 13, 2023 23:41
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
@mroeschke mroeschke added this to the 2.1 milestone Mar 14, 2023
@mroeschke mroeschke merged commit 506fe53 into pandas-dev:main Mar 14, 2023
@mroeschke
Copy link
Member

Thanks @phofl

@phofl phofl deleted the orc_raising branch March 14, 2023 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality IO Parquet parquet, feather
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants