You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "sadpandajoe (via GitHub)" <gi...@apache.org> on 2026/10/03 08:49:04 UTC

[PR] fix(mypy): ignore false-positive union-attr on Slice.uuid.in_() [superset]

sadpandajoe opened a new pull request, #44944:
URL: https://github.com/apache/superset/pull/44944

   Fixes #44943
   
   ### SUMMARY
   
   The nightly full-repo mypy sweep fails with two `[union-attr]` errors on
   `Slice.uuid.in_()` in the chart importer (added by #43232):
   
   ```
   superset/commands/chart/importers/v1/__init__.py:162: error: Item "UUID" of "UUID | None" has no attribute "in_"  [union-attr]
   superset/commands/chart/importers/v1/__init__.py:162: error: Item "None" of "UUID | None" has no attribute "in_"  [union-attr]
   ```
   
   superset-core's abstract `Chart` (imported as `CoreChart`) declares `uuid` as a
   plain `uuid: UUID | None` annotation rather than a column. `Slice` lists
   `CoreChart` ahead of `ImportExportMixin`/`UUIDMixin`, which supplies the real
   `uuid` Column, and defines no `uuid` of its own — so when superset-core's
   sources are part of the same mypy run, mypy resolves `Slice.uuid` through
   `CoreChart`'s annotation instead of the Column descriptor and rejects `.in_()`.
   Per-PR runs only check changed files, where `superset_core.*` is
   `follow_imports = "skip"`, so the false positive appears in the nightly
   full-repo lint only.
   
   This adds a `# type: ignore[union-attr]` at the call site plus a matching
   `warn_unused_ignores = false` override, extending the block that already covers
   the identical `SqlaTable.uuid.in_()` case in
   `superset/mcp_service/dataset_scope.py`. The override is required: without it
   the ignore is reported as `[unused-ignore]` in scoped runs, since global
   `warn_unused_ignores` is on.
   
   Reordering `Slice`'s base classes would address the annotation shadowing at its
   source, but that mutates the MRO of a declarative model with several mixins to
   silence a lint-only symptom, and `CoreChart` is first by design as the
   host-replaced interface. This follows the established precedent instead.
   
   No runtime behavior change.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — lint-only change.
   
   ### TESTING INSTRUCTIONS
   
   Reproduce the failure by reverting both hunks and running mypy with
   superset-core's sources in the same invocation:
   
   ```bash
   mypy --check-untyped-defs \
     superset/commands/chart/importers/v1/__init__.py \
     superset-core/src/superset_core/common/models.py
   ```
   
   Reverted: two `[union-attr]` errors at line 162. With the fix: clean.
   The same file checked on its own (scoped mode) is clean either way, and is also
   clean with the fix applied — confirming the ignore is not flagged as unused.
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: Fixes #44943
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mypy): ignore false-positive union-attr on Slice.uuid.in_() [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #44944:
URL: https://github.com/apache/superset/pull/44944#issuecomment-5967333106

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mypy): ignore false-positive union-attr on Slice.uuid.in_() [superset]

Posted by "hainenber (via GitHub)" <gi...@apache.org>.
hainenber merged PR #44944:
URL: https://github.com/apache/superset/pull/44944


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(mypy): ignore false-positive union-attr on Slice.uuid.in_() [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #44944:
URL: https://github.com/apache/superset/pull/44944#issuecomment-5967526151

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/44944?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 66.09%. Comparing base ([`f1ae890`](https://app.codecov.io/gh/apache/superset/commit/f1ae8909d85f9c8ff39e834a9eee00f88f2aa32d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`64e6b29`](https://app.codecov.io/gh/apache/superset/commit/64e6b2962e1d90e27d619d824b2696e722b67309?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on master.
   > :exclamation:  There is a different number of reports uploaded between BASE (f1ae890) and HEAD (64e6b29). Click for more details.
   > 
   > <details><summary>HEAD has 4 uploads less than BASE</summary>
   >
   >| Flag | BASE (f1ae890) | HEAD (64e6b29) |
   >|------|------|------|
   >|python|7|3|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #44944       +/-   ##
   ===========================================
   - Coverage   82.28%   66.09%   -16.20%     
   ===========================================
     Files        2996     2996               
     Lines      185055   185055               
     Branches    42828    42828               
   ===========================================
   - Hits       152265   122303    -29962     
   - Misses      30028    60069    +30041     
   + Partials     2762     2683       -79     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/44944/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/44944/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `36.30% <ø> (ø)` | |
   | [mysql](https://app.codecov.io/gh/apache/superset/pull/44944/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [postgres](https://app.codecov.io/gh/apache/superset/pull/44944/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/44944/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `38.17% <ø> (ø)` | |
   | [python](https://app.codecov.io/gh/apache/superset/pull/44944/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.19% <ø> (-31.04%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/44944/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.07% <ø> (ø)` | |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/44944/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   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.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/44944?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org