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

chore: remove unused functions in utils/core #25912

Merged

Conversation

sebastianliebscher
Copy link
Contributor

@sebastianliebscher sebastianliebscher commented Nov 8, 2023

SUMMARY

This PR removes unused functions in utils/core.py

TESTING INSTRUCTIONS

  • unit + integration tests / CI

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@rusackas
Copy link
Member

rusackas commented Nov 8, 2023

Thanks for cleaning up the place!

Copy link
Member

@john-bodley john-bodley left a 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 john-bodley merged commit e036919 into apache:master Nov 8, 2023
29 checks passed
@sebastianliebscher sebastianliebscher deleted the chore/remove_unused_func branch November 8, 2023 23:40
@sebastianliebscher
Copy link
Contributor Author

@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.

josedev-union pushed a commit to Ortege-xyz/studio that referenced this pull request Jan 22, 2024
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.1.0 labels Mar 8, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants