@@ -114,7 +114,7 @@ def ints_to_pydatetime(
114
114
const int64_t[:] arr ,
115
115
object tz = None ,
116
116
object freq = None ,
117
- bint fold = 0 ,
117
+ bint fold = False ,
118
118
str box = " datetime"
119
119
):
120
120
"""
@@ -288,7 +288,8 @@ def format_array_from_datetime(
288
288
cdef:
289
289
int64_t val, ns, N = len (values)
290
290
ndarray[int64_t] consider_values
291
- bint show_ms = 0 , show_us = 0 , show_ns = 0 , basic_format = 0
291
+ bint show_ms = False , show_us = False , show_ns = False
292
+ bint basic_format = False
292
293
ndarray[object ] result = np.empty(N, dtype = object )
293
294
object ts, res
294
295
npy_datetimestruct dts
@@ -576,10 +577,10 @@ cpdef array_to_datetime(
576
577
ndarray[object ] oresult
577
578
npy_datetimestruct dts
578
579
bint utc_convert = bool (utc)
579
- bint seen_integer = 0
580
- bint seen_string = 0
581
- bint seen_datetime = 0
582
- bint seen_datetime_offset = 0
580
+ bint seen_integer = False
581
+ bint seen_string = False
582
+ bint seen_datetime = False
583
+ bint seen_datetime_offset = False
583
584
bint is_raise = errors== ' raise'
584
585
bint is_ignore = errors== ' ignore'
585
586
bint is_coerce = errors== ' coerce'
@@ -606,7 +607,7 @@ cpdef array_to_datetime(
606
607
iresult[i] = NPY_NAT
607
608
608
609
elif PyDateTime_Check(val):
609
- seen_datetime = 1
610
+ seen_datetime = True
610
611
if val.tzinfo is not None :
611
612
if utc_convert:
612
613
_ts = convert_datetime_to_tsobject(val, None )
@@ -622,17 +623,17 @@ cpdef array_to_datetime(
622
623
check_dts_bounds(& dts)
623
624
624
625
elif PyDate_Check(val):
625
- seen_datetime = 1
626
+ seen_datetime = True
626
627
iresult[i] = pydate_to_dt64(val, & dts)
627
628
check_dts_bounds(& dts)
628
629
629
630
elif is_datetime64_object(val):
630
- seen_datetime = 1
631
+ seen_datetime = True
631
632
iresult[i] = get_datetime64_nanos(val)
632
633
633
634
elif is_integer_object(val) or is_float_object(val):
634
635
# these must be ns unit by-definition
635
- seen_integer = 1
636
+ seen_integer = True
636
637
637
638
if val != val or val == NPY_NAT:
638
639
iresult[i] = NPY_NAT
@@ -651,7 +652,7 @@ cpdef array_to_datetime(
651
652
652
653
elif isinstance (val, str ):
653
654
# string
654
- seen_string = 1
655
+ seen_string = True
655
656
656
657
if len (val) == 0 or val in nat_strings:
657
658
iresult[i] = NPY_NAT
@@ -693,7 +694,7 @@ cpdef array_to_datetime(
693
694
raise TypeError (" invalid string coercion to datetime" )
694
695
695
696
if tz is not None :
696
- seen_datetime_offset = 1
697
+ seen_datetime_offset = True
697
698
# dateutil timezone objects cannot be hashed, so
698
699
# store the UTC offsets in seconds instead
699
700
out_tzoffset_vals.add(tz.total_seconds())
@@ -709,7 +710,7 @@ cpdef array_to_datetime(
709
710
# where we left off
710
711
value = dtstruct_to_dt64(& dts)
711
712
if out_local == 1 :
712
- seen_datetime_offset = 1
713
+ seen_datetime_offset = True
713
714
# Store the out_tzoffset in seconds
714
715
# since we store the total_seconds of
715
716
# dateutil.tz.tzoffset objects
0 commit comments