@@ -56,8 +56,19 @@ TD64NS_DTYPE = np.dtype('m8[ns]')
5656# Unit Conversion Helpers
5757
5858cdef inline int64_t cast_from_unit(object ts, str unit) except ? - 1 :
59- """ return a casting of the unit represented to nanoseconds
60- round the fractional part of a float to our precision, p """
59+ """
60+ Return a casting of the unit represented to nanoseconds
61+ round the fractional part of a float to our precision, p.
62+
63+ Parameters
64+ ----------
65+ ts : int, float, or None
66+ unit : str
67+
68+ Returns
69+ -------
70+ int64_t
71+ """
6172 cdef:
6273 int64_t m
6374 int p
@@ -307,7 +318,7 @@ cdef class _TSObject:
307318 return self .value
308319
309320
310- cdef convert_to_tsobject(object ts, tzinfo tz, object unit,
321+ cdef convert_to_tsobject(object ts, tzinfo tz, str unit,
311322 bint dayfirst, bint yearfirst, int32_t nanos = 0 ):
312323 """
313324 Extract datetime and int64 from any of:
@@ -497,7 +508,7 @@ cdef _TSObject _create_tsobject_tz_using_offset(npy_datetimestruct dts,
497508 return obj
498509
499510
500- cdef _TSObject _convert_str_to_tsobject(object ts, tzinfo tz, object unit,
511+ cdef _TSObject _convert_str_to_tsobject(object ts, tzinfo tz, str unit,
501512 bint dayfirst = False ,
502513 bint yearfirst = False ):
503514 """
@@ -513,6 +524,7 @@ cdef _TSObject _convert_str_to_tsobject(object ts, tzinfo tz, object unit,
513524 Value to be converted to _TSObject
514525 tz : tzinfo or None
515526 timezone for the timezone-aware output
527+ unit : str or None
516528 dayfirst : bool, default False
517529 When parsing an ambiguous date string, interpret e.g. "3/4/1975" as
518530 April 3, as opposed to the standard US interpretation March 4.
0 commit comments