Skip to content

move is_null_datetimelike to nattype for self-containment #21692

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

Merged
merged 4 commits into from
Jul 2, 2018

Conversation

jbrockmendel
Copy link
Member

ATM is_null_datetimelike is used only in tslibs.period. The dependency structure is simplified nicely if we put that function is tslibs.nattype instead of in _libs.missing.

This also takes a couple of missing-themed functions out of inference.pyx

Finally, moves the libperiod block in setup.py to down with the rest of the tslibs blocks to restore alphabetical order.

@codecov
Copy link

codecov bot commented Jul 1, 2018

Codecov Report

Merging #21692 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #21692   +/-   ##
=======================================
  Coverage    91.9%    91.9%           
=======================================
  Files         154      154           
  Lines       49659    49659           
=======================================
  Hits        45640    45640           
  Misses       4019     4019
Flag Coverage Δ
#multiple 90.28% <ø> (ø) ⬆️
#single 41.89% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad76ffc...1b798bf. Read the comment docs.

@@ -1,6 +1,12 @@
# -*- coding: utf-8 -*-
# cython: profile=False

cdef bint is_null_datetimelike(object val)
from tslibs.nattype cimport is_null_datetimelike
# pass-through so other modules can cimport is_null_datetimelike from here
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this comment needed? this is for api simplicity yes? if so i don’t think really necessary for a comment

@jreback
Copy link
Contributor

jreback commented Jul 2, 2018

needs a rebase

@jreback jreback added Datetime Datetime data dtype Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Jul 2, 2018
return True
elif val is NaT:
return True
elif util.is_timedelta64_object(val):
Copy link
Member

Choose a reason for hiding this comment

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

why import this from util? Didn't you move it to tslibs.missing ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure I understand the question. This PR is moving this function from _libs.missing to tslibs.nattype because doing so simplifies the dependency structure.

Copy link
Member

Choose a reason for hiding this comment

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

and by moving the function should not change the import?

Copy link
Contributor

Choose a reason for hiding this comment

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

these util functions of basically c versions of isinstance checks, so this is ok.

@jreback jreback added this to the 0.24.0 milestone Jul 2, 2018
@jreback jreback merged commit 1af2f6c into pandas-dev:master Jul 2, 2018
@jreback
Copy link
Contributor

jreback commented Jul 2, 2018

thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the contained branch July 2, 2018 23:37
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants