Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reenabled no-unused-function in setup.py #29767

Merged
merged 1 commit into from
Nov 22, 2019

Conversation

WillAyd
Copy link
Member

@WillAyd WillAyd commented Nov 21, 2019

This enables a flag that was disabled 4 years ago in e9fde88 but maybe worth reconsidering, even though we don't fail on warnings for extensions in CI

This yielded the following on master:

pandas/_libs/hashing.c:25313:20: warning: unused function '__pyx_memview_get_object' [-Wunused-function]
pandas/_libs/hashing.c:25318:12: warning: unused function '__pyx_memview_set_object' [-Wunused-function]
pandas/_libs/hashtable.c:63342:20: warning: unused function '__pyx_memview_get_object' [-Wunused-function]
pandas/_libs/hashtable.c:63347:12: warning: unused function '__pyx_memview_set_object' [-Wunused-function]
pandas/_libs/parsers.c:21453:18: warning: unused function '__pyx_f_6pandas_5_libs_7parsers__string_box_factorize' [-Wunused-function]
pandas/_libs/tslibs/conversion.c:33247:20: warning: unused function '__pyx_memview_get_object' [-Wunused-function]
pandas/_libs/tslibs/conversion.c:33252:12: warning: unused function '__pyx_memview_set_object' [-Wunused-function]
pandas/_libs/tslibs/nattype.c:3496:18: warning: unused function '__pyx_pw_6pandas_5_libs_6tslibs_7nattype_4_NaT_1__hash__' [-Wunused-function]
pandas/_libs/src/ujson/python/objToJSON.c:403:14: warning: unused function 'PyIntToINT64' [-Wunused-function]

I'm not sure what the memview_set_object and memview_get_object complaints are coming from just yet, but the rest are cleaned up in this PR

@WillAyd WillAyd added the Clean label Nov 21, 2019
@simonjayhawkins simonjayhawkins added this to the 1.0 milestone Nov 21, 2019
@@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure this can be removed? (do you know why?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two __hash__ definitions for this class so I suppose the second one takes priority

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that's a good reason to remove it ;)

@@ -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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is completely unused?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea this is the only thing that appears in a grep of _libs

$ grep -nr "_string_box_factorize" pandas/_libs
pandas/_libs/parsers.pyx:1409:cdef _string_box_factorize(parser_t *parser, int64_t col,

cdef as well so can't be called from outside of there

@jbrockmendel
Copy link
Member

looks like a nice cleanup

@jreback jreback merged commit 62c3ff5 into pandas-dev:master Nov 22, 2019
@jreback
Copy link
Contributor

jreback commented Nov 22, 2019

thanks @WillAyd

keechongtan added a commit to keechongtan/pandas that referenced this pull request Nov 25, 2019
…ndexing-1row-df

* upstream/master: (185 commits)
  ENH: add BooleanArray extension array (pandas-dev#29555)
  DOC: Add link to dev calendar and meeting notes (pandas-dev#29737)
  ENH: Add built-in function for Styler to format the text displayed for missing values (pandas-dev#29118)
  DEPR: remove statsmodels/seaborn compat shims (pandas-dev#29822)
  DEPR: remove Index.summary (pandas-dev#29807)
  DEPR: passing an int to read_excel use_cols (pandas-dev#29795)
  STY: fstrings in io.pytables (pandas-dev#29758)
  BUG: Fix melt with mixed int/str columns (pandas-dev#29792)
  TST: add test for ffill/bfill for non unique multilevel (pandas-dev#29763)
  Changed description of parse_dates in read_excel(). (pandas-dev#29796)
  BUG: pivot_table not returning correct type when margin=True and aggfunc='mean'  (pandas-dev#28248)
  REF: Create _lib/window directory (pandas-dev#29817)
  Fixed small mistake (pandas-dev#29815)
  minor cleanups (pandas-dev#29798)
  DEPR: enforce deprecations in core.internals (pandas-dev#29723)
  add test for unused level raises KeyError (pandas-dev#29760)
  Add documentation linking to sqlalchemy (pandas-dev#29373)
  io/parsers: ensure decimal is str on PythonParser (pandas-dev#29743)
  Reenabled no-unused-function (pandas-dev#29767)
  CLN:F-string in pandas/_libs/tslibs/*.pyx (pandas-dev#29775)
  ...

# Conflicts:
#	pandas/tests/frame/indexing/test_indexing.py
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
@WillAyd WillAyd deleted the clean-unused-funcs branch April 12, 2023 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants