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

pandas.Timestamp as an annotation causes TypeError #70

Closed
xbanke opened this issue Apr 30, 2020 · 3 comments · Fixed by #71
Closed

pandas.Timestamp as an annotation causes TypeError #70

xbanke opened this issue Apr 30, 2020 · 3 comments · Fixed by #71
Assignees
Labels
bug Something isn't working

Comments

@xbanke
Copy link

xbanke commented Apr 30, 2020

  • typical version: 2.0.8
  • Python version: 3.7.4
  • Operating System:

Description

pandas.Timestamp is a sub-class of datetime, but as an annotation will cause TypeError:

import typic
from datetime import datetime
import pandas as pd


issubclass(pd.Timestamp, datetime)  # True


@typic.klass
class Foo:
    dt: pd.Timestamp
# TypeError: __init__() got an unexpected keyword argument 'additionalProperties'

This is OK at version 2.0.5.
Personally, I think pandas.Timestamp is more convenient than builtin datetime in data analysis.

@seandstewart
Copy link
Owner

This is a regression due to expanding awareness of subtypes. Should have a fix shortly.

@seandstewart
Copy link
Owner

This has been resolved in v2.0.9

@xbanke
Copy link
Author

xbanke commented Apr 30, 2020

Thanks.

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

Successfully merging a pull request may close this issue.

2 participants