Skip to content

Commit

Permalink
Reenabled no-unused-function (#29767)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd authored and jreback committed Nov 22, 2019
1 parent 24684e2 commit 62c3ff5
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 74 deletions.
53 changes: 0 additions & 53 deletions pandas/_libs/parsers.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1406,59 +1406,6 @@ cdef inline StringPath _string_path(char *encoding):
# Type conversions / inference support code


cdef _string_box_factorize(parser_t *parser, int64_t col,
int64_t line_start, int64_t line_end,
bint na_filter, kh_str_starts_t *na_hashset):
cdef:
int error, na_count = 0
Py_ssize_t i, lines
coliter_t it
const char *word = NULL
ndarray[object] result

int ret = 0
kh_strbox_t *table

object pyval

object NA = na_values[np.object_]
khiter_t k

table = kh_init_strbox()
lines = line_end - line_start
result = np.empty(lines, dtype=np.object_)
coliter_setup(&it, parser, col, line_start)

for i in range(lines):
COLITER_NEXT(it, word)

if na_filter:
if kh_get_str_starts_item(na_hashset, word):
# in the hash table
na_count += 1
result[i] = NA
continue

k = kh_get_strbox(table, word)

# in the hash table
if k != table.n_buckets:
# this increments the refcount, but need to test
pyval = <object>table.vals[k]
else:
# box it. new ref?
pyval = PyBytes_FromString(word)

k = kh_put_strbox(table, word, &ret)
table.vals[k] = <PyObject*>pyval

result[i] = pyval

kh_destroy_strbox(table)

return result, na_count


cdef _string_box_utf8(parser_t *parser, int64_t col,
int64_t line_start, int64_t line_end,
bint na_filter, kh_str_starts_t *na_hashset):
Expand Down
16 changes: 0 additions & 16 deletions pandas/_libs/src/ujson/python/objToJSON.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,22 +399,6 @@ static void *CLong(JSOBJ obj, JSONTypeContext *tc, void *outValue,
return NULL;
}

#ifdef _LP64
static void *PyIntToINT64(JSOBJ _obj, JSONTypeContext *tc, void *outValue,
size_t *_outLen) {
PyObject *obj = (PyObject *)_obj;
*((JSINT64 *)outValue) = PyLong_AsLong(obj);
return NULL;
}
#else
static void *PyIntToINT32(JSOBJ _obj, JSONTypeContext *tc, void *outValue,
size_t *_outLen) {
PyObject *obj = (PyObject *)_obj;
*((JSINT32 *)outValue) = PyLong_AsLong(obj);
return NULL;
}
#endif

static void *PyLongToINT64(JSOBJ _obj, JSONTypeContext *tc, void *outValue,
size_t *_outLen) {
*((JSINT64 *)outValue) = GET_TC(tc)->longValue;
Expand Down
4 changes: 0 additions & 4 deletions pandas/_libs/tslibs/nattype.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ cdef class _NaT(datetime):
# higher than np.ndarray and np.matrix
__array_priority__ = 100

def __hash__(_NaT self):
# py3k needs this defined here
return hash(self.value)

def __richcmp__(_NaT self, object other, int op):
cdef:
int ndim = getattr(other, 'ndim', -1)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def run(self):
extra_link_args.append("/DEBUG")
else:
# args to ignore warnings
extra_compile_args = ["-Wno-unused-function"]
extra_compile_args = []
extra_link_args = []
if debugging_symbols_requested:
extra_compile_args.append("-g")
Expand Down

0 comments on commit 62c3ff5

Please sign in to comment.