Skip to content

Commit c81b0ba

Browse files
authored
Clean Up C Warnings (#31935)
1 parent 8444453 commit c81b0ba

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

pandas/_libs/algos.pyx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1173,12 +1173,12 @@ ctypedef fused out_t:
11731173

11741174
@cython.boundscheck(False)
11751175
@cython.wraparound(False)
1176-
def diff_2d(ndarray[diff_t, ndim=2] arr,
1177-
ndarray[out_t, ndim=2] out,
1176+
def diff_2d(diff_t[:, :] arr,
1177+
out_t[:, :] out,
11781178
Py_ssize_t periods, int axis):
11791179
cdef:
11801180
Py_ssize_t i, j, sx, sy, start, stop
1181-
bint f_contig = arr.flags.f_contiguous
1181+
bint f_contig = arr.is_f_contig()
11821182

11831183
# Disable for unsupported dtype combinations,
11841184
# see https://github.com/cython/cython/issues/2646

pandas/_libs/hashing.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import cython
55
from libc.stdlib cimport malloc, free
66

77
import numpy as np
8-
from numpy cimport uint8_t, uint32_t, uint64_t, import_array
8+
from numpy cimport ndarray, uint8_t, uint32_t, uint64_t, import_array
99
import_array()
1010

1111
from pandas._libs.util cimport is_nan
@@ -15,7 +15,7 @@ DEF dROUNDS = 4
1515

1616

1717
@cython.boundscheck(False)
18-
def hash_object_array(object[:] arr, object key, object encoding='utf8'):
18+
def hash_object_array(ndarray[object] arr, object key, object encoding='utf8'):
1919
"""
2020
Parameters
2121
----------

pandas/_libs/tslibs/conversion.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def ensure_timedelta64ns(arr: ndarray, copy: bool=True):
152152

153153
@cython.boundscheck(False)
154154
@cython.wraparound(False)
155-
def datetime_to_datetime64(object[:] values):
155+
def datetime_to_datetime64(ndarray[object] values):
156156
"""
157157
Convert ndarray of datetime-like objects to int64 array representing
158158
nanosecond timestamps.

pandas/_libs/window/aggregations.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ cdef:
5656
cdef inline int int_max(int a, int b): return a if a >= b else b
5757
cdef inline int int_min(int a, int b): return a if a <= b else b
5858

59-
cdef inline bint is_monotonic_start_end_bounds(
59+
cdef bint is_monotonic_start_end_bounds(
6060
ndarray[int64_t, ndim=1] start, ndarray[int64_t, ndim=1] end
6161
):
6262
return is_monotonic(start, False)[0] and is_monotonic(end, False)[0]

0 commit comments

Comments
 (0)