fix: type annotation breaking on py3.9
SUMMARY
A recent change as broke Superset on python 3.9. To my understanding we still support python 3.9 as per https://github.com/apache/superset/blob/master/pyproject.toml#L27
I do think we should run our tests on the minimal python version as well to avoid these issues, but I'm not sure on how to change it on github actions, or we don't set it or we use python-version: ["current", "next"]
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
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
Thanks for the fix @dpgaspar!
I do think we should run our tests on the minimal python version as well to avoid these issues, but I'm not sure on how to change it on github actions, or we don't set it or we use python-version: ["current", "next"]
That's a fair point. I didn't even notice that we were missing the from __future__ import annotations because neither the tests or pre-commit hook complained about it. I believe we'll have many more of these problems if these checks don't catch these types of errors.
@mistercrunch Is it possible to fix this?
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 83.13%. Comparing base (
2e5f3ed) to head (826f6de). Report is 58 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #28396 +/- ##
===========================================
+ Coverage 60.49% 83.13% +22.64%
===========================================
Files 1931 521 -1410
Lines 76241 37256 -38985
Branches 8566 0 -8566
===========================================
- Hits 46122 30973 -15149
+ Misses 28015 6283 -21732
+ Partials 2104 0 -2104
| Flag | Coverage Δ | |
|---|---|---|
| hive | ? |
|
| javascript | ? |
|
| mysql | 77.20% <100.00%> (?) |
|
| postgres | 77.32% <100.00%> (?) |
|
| presto | 53.66% <100.00%> (-0.14%) |
:arrow_down: |
| python | 83.13% <100.00%> (+19.64%) |
:arrow_up: |
| sqlite | 76.78% <100.00%> (?) |
|
| unit | 58.35% <100.00%> (+0.72%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
https://github.com/apache/superset/pull/28419 should help prevent this