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

Index name defined in DataFrameModel is discarded when creating DataFrameSchema #1474

Open
2 of 3 tasks
crsren opened this issue Jan 31, 2024 · 0 comments
Open
2 of 3 tasks
Labels
bug Something isn't working

Comments

@crsren
Copy link

crsren commented Jan 31, 2024

Describe the bug
When creating a schema from a DataFrameModel, the name of the index is discarded.

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of pandera. (0.18.0)
  • (optional) I have confirmed this bug exists on the master branch of pandera.

Code Sample

class Pinapple(pa.DataFrameModel):
    id: Index[int]
    name: Series[str]
    
pinapple_schema = Pinapple.to_schema()

Expected behavior

I'm expecting pinapple_schema to have the attribute index=<Schema Index(name=id, type=DataType(string[pyarrow]))>. While the type is correct, the name instead is just None.

@crsren crsren added the bug Something isn't working label Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant