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

If pandas index class is used in schema, Index type wrapper should not be needed #9

Open
pierreprecis opened this issue Oct 20, 2023 · 0 comments

Comments

@pierreprecis
Copy link
Collaborator

pierreprecis commented Oct 20, 2023

Pandas have several index types, e.g., pandas.Int64Index, pandas DatetimeIndex, pandas.CategoricalIndex.

in a schema definition one should be able to use pandas index types as "index markers" and not need to wrap the in pandabear.Index type.

# current behaviour if this types where supported
class MySchema(DataframeModel):
    date: Index[pd.DatetimeIndex]
    ...

# nicer:
class MySchema(DataframeModel):
    date: pd.DatetimeIndex
    ...
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

No branches or pull requests

1 participant