apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
61.98k stars 13.59k forks source link

feat(be/cfg): replace deprecated imp.load_source with importlib.util #30390

Open hainenber opened 2 days ago

hainenber commented 2 days ago

feat(be/cfg): replace deprecated imp.load_source with importlib.util

Thanks to spack's alazo snippet :D

SUMMARY

imp module would be deprecated in Python 3.12. We can replace it with importlib.util functions

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

After this change, I can run Superset locally with SUPERSET_CONFIG_PATH properly pointed

image

ADDITIONAL INFORMATION

codecov[bot] commented 2 days ago

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 83.89%. Comparing base (76d897e) to head (d3836ac). Report is 774 commits behind head on master.

Files with missing lines Patch % Lines
superset/config.py 0.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #30390 +/- ## =========================================== + Coverage 60.48% 83.89% +23.40% =========================================== Files 1931 533 -1398 Lines 76236 38520 -37716 Branches 8568 0 -8568 =========================================== - Hits 46114 32317 -13797 + Misses 28017 6203 -21814 + Partials 2105 0 -2105 ``` | [Flag](https://app.codecov.io/gh/apache/superset/pull/30390/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [hive](https://app.codecov.io/gh/apache/superset/pull/30390/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `48.99% <0.00%> (-0.17%)` | :arrow_down: | | [javascript](https://app.codecov.io/gh/apache/superset/pull/30390/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | | | [mysql](https://app.codecov.io/gh/apache/superset/pull/30390/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `76.84% <0.00%> (?)` | | | [postgres](https://app.codecov.io/gh/apache/superset/pull/30390/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `76.94% <0.00%> (?)` | | | [presto](https://app.codecov.io/gh/apache/superset/pull/30390/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `53.49% <0.00%> (-0.31%)` | :arrow_down: | | [python](https://app.codecov.io/gh/apache/superset/pull/30390/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.89% <0.00%> (+20.40%)` | :arrow_up: | | [sqlite](https://app.codecov.io/gh/apache/superset/pull/30390/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `76.39% <0.00%> (?)` | | | [unit](https://app.codecov.io/gh/apache/superset/pull/30390/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `60.64% <0.00%> (+3.02%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.