Skip to content

is_scalar should return True for DateOffset objects #18943

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

Closed
jbrockmendel opened this issue Dec 26, 2017 · 2 comments · Fixed by #18982
Closed

is_scalar should return True for DateOffset objects #18943

jbrockmendel opened this issue Dec 26, 2017 · 2 comments · Fixed by #18982
Labels
Compat pandas objects compatability with Numpy or Python functions Frequency DateOffsets good first issue
Milestone

Comments

@jbrockmendel
Copy link
Member

No description provided.

@jreback jreback added Compat pandas objects compatability with Numpy or Python functions Effort Low Frequency DateOffsets good first issue labels Dec 26, 2017
@jreback jreback added this to the Next Major Release milestone Dec 26, 2017
@databasedav
Copy link
Contributor

I am attempting this as a first issue.

I traced the is_scalar function back to its implementation which is in Cython and it uses checks imported from the CPython datetime library to check the for the listed datetime objects. DateOffset objects are specific to Pandas so what would my next steps be here? I imagine importing DateOffset from where ever it's defined and using isinstance is not the answer...

@jreback
Copy link
Contributor

jreback commented Dec 28, 2017

need to add a is_offset to pandas/_libs/src/inference.pyx, then you can use this in isscalar. this would look very similar to pandas/_libs/src/util.pxd/is_period_object (you don't need to define it also in util.pxd though).

is_offset should also be imported / tested in pandas/core/dtypes/common.py

@jreback jreback modified the milestones: Next Major Release, 0.23.0 Dec 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Frequency DateOffsets good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants