-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
chore: remove unused functions in utils/core #25912
chore: remove unused functions in utils/core #25912
Conversation
Thanks for cleaning up the place! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after confirming that the functions were unused. I've kicked off a rerun of a failing CI job which seems unrelated to your change.
@sebastianliebscher my sense is there's likely a bunch of old unused Python code and would love to see it removed. I've tried out tools like Vulture in the past but sadly the accuracy was rather poor and even when setting the confidence level to 80% there are a number of false negatives, i.e., none of the unused functions you identified where detected:
$ vulture superset --min-confidence 80
superset/cli/native_filters.py:103: unused variable 'all_' (100% confidence)
superset/cli/native_filters.py:253: unused variable 'all_' (100% confidence)
superset/cli/native_filters.py:350: unused variable 'all_' (100% confidence)
superset/db_engine_specs/hive.py:54: unused import 'TFetchOrientation' (90% confidence)
superset/examples/data_loading.py:28: unused import 'load_multiformat_time_series' (90% confidence)
superset/examples/data_loading.py:29: unused import 'load_paris_iris_geojson' (90% confidence)
superset/examples/data_loading.py:30: unused import 'load_random_time_series_data' (90% confidence)
superset/extensions/metadb.py:198: unused variable 'fast' (100% confidence)
superset/migrations/env.py:87: unused variable 'revision' (100% confidence)
superset/utils/core.py:763: unused variable 'frame' (100% confidence)
superset/utils/core.py:763: unused variable 'signum' (100% confidence)
superset/utils/log.py:109: unused variable 'exc_tb' (100% confidence)
superset/utils/log.py:109: unused variable 'exc_type' (100% confidence)
superset/utils/log.py:109: unused variable 'exc_val' (100% confidence)
superset/views/database/views.py:50: unused import 'FileStorage' (90% confidence)
@john-bodley thanks for pointing out the tool, I didn't know about it before. After trying it out, I agree with you about the poor accuracy and false positives. Even at 100% confidence level (which could possibly be used in a CI pipeline) it is unfortunately not very helpful IMO. |
SUMMARY
This PR removes unused functions in
utils/core.py
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION