Skip to content

Commit 273265b

Browse files
WillAydproost
authored andcommitted
Reenabled no-unused-function (pandas-dev#29767)
1 parent 3728a70 commit 273265b

File tree

4 files changed

+1
-74
lines changed

4 files changed

+1
-74
lines changed

pandas/_libs/parsers.pyx

-53
Original file line numberDiff line numberDiff line change
@@ -1406,59 +1406,6 @@ cdef inline StringPath _string_path(char *encoding):
14061406
# Type conversions / inference support code
14071407

14081408

1409-
cdef _string_box_factorize(parser_t *parser, int64_t col,
1410-
int64_t line_start, int64_t line_end,
1411-
bint na_filter, kh_str_starts_t *na_hashset):
1412-
cdef:
1413-
int error, na_count = 0
1414-
Py_ssize_t i, lines
1415-
coliter_t it
1416-
const char *word = NULL
1417-
ndarray[object] result
1418-
1419-
int ret = 0
1420-
kh_strbox_t *table
1421-
1422-
object pyval
1423-
1424-
object NA = na_values[np.object_]
1425-
khiter_t k
1426-
1427-
table = kh_init_strbox()
1428-
lines = line_end - line_start
1429-
result = np.empty(lines, dtype=np.object_)
1430-
coliter_setup(&it, parser, col, line_start)
1431-
1432-
for i in range(lines):
1433-
COLITER_NEXT(it, word)
1434-
1435-
if na_filter:
1436-
if kh_get_str_starts_item(na_hashset, word):
1437-
# in the hash table
1438-
na_count += 1
1439-
result[i] = NA
1440-
continue
1441-
1442-
k = kh_get_strbox(table, word)
1443-
1444-
# in the hash table
1445-
if k != table.n_buckets:
1446-
# this increments the refcount, but need to test
1447-
pyval = <object>table.vals[k]
1448-
else:
1449-
# box it. new ref?
1450-
pyval = PyBytes_FromString(word)
1451-
1452-
k = kh_put_strbox(table, word, &ret)
1453-
table.vals[k] = <PyObject*>pyval
1454-
1455-
result[i] = pyval
1456-
1457-
kh_destroy_strbox(table)
1458-
1459-
return result, na_count
1460-
1461-
14621409
cdef _string_box_utf8(parser_t *parser, int64_t col,
14631410
int64_t line_start, int64_t line_end,
14641411
bint na_filter, kh_str_starts_t *na_hashset):

pandas/_libs/src/ujson/python/objToJSON.c

-16
Original file line numberDiff line numberDiff line change
@@ -399,22 +399,6 @@ static void *CLong(JSOBJ obj, JSONTypeContext *tc, void *outValue,
399399
return NULL;
400400
}
401401

402-
#ifdef _LP64
403-
static void *PyIntToINT64(JSOBJ _obj, JSONTypeContext *tc, void *outValue,
404-
size_t *_outLen) {
405-
PyObject *obj = (PyObject *)_obj;
406-
*((JSINT64 *)outValue) = PyLong_AsLong(obj);
407-
return NULL;
408-
}
409-
#else
410-
static void *PyIntToINT32(JSOBJ _obj, JSONTypeContext *tc, void *outValue,
411-
size_t *_outLen) {
412-
PyObject *obj = (PyObject *)_obj;
413-
*((JSINT32 *)outValue) = PyLong_AsLong(obj);
414-
return NULL;
415-
}
416-
#endif
417-
418402
static void *PyLongToINT64(JSOBJ _obj, JSONTypeContext *tc, void *outValue,
419403
size_t *_outLen) {
420404
*((JSINT64 *)outValue) = GET_TC(tc)->longValue;

pandas/_libs/tslibs/nattype.pyx

-4
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ cdef class _NaT(datetime):
9595
# higher than np.ndarray and np.matrix
9696
__array_priority__ = 100
9797

98-
def __hash__(_NaT self):
99-
# py3k needs this defined here
100-
return hash(self.value)
101-
10298
def __richcmp__(_NaT self, object other, int op):
10399
cdef:
104100
int ndim = getattr(other, 'ndim', -1)

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ def run(self):
463463
extra_link_args.append("/DEBUG")
464464
else:
465465
# args to ignore warnings
466-
extra_compile_args = ["-Wno-unused-function"]
466+
extra_compile_args = []
467467
extra_link_args = []
468468
if debugging_symbols_requested:
469469
extra_compile_args.append("-g")

0 commit comments

Comments
 (0)