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

[PR] fix(mcp): set .embedded on update_dashboard test mocks [superset]

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

   ### SUMMARY
   
   Master's Python-Unit CI is red. Five tests in `tests/unit_tests/mcp_service/dashboard/tool/test_update_dashboard.py` fail with:
   
   ```
   fastmcp.exceptions.ToolError: Error calling tool 'update_dashboard': 'Mock' object is not subscriptable
   ```
   
   The cause is the shared `dashboard_serializer` in `superset/mcp_service/dashboard/schemas.py`. #41195 added:
   
   ```python
   embedded_uuid=str(dashboard.embedded[0].uuid) if dashboard.embedded else None,
   ```
   
   That production code is fine: a real `dashboard.embedded` is an empty list when the dashboard isn't embedded, so the guard short-circuits. The problem is that `update_dashboard` routes through the same serializer, and the test mocks in `test_update_dashboard.py` never set `.embedded`. Mock hands back a truthy auto-Mock, the `if dashboard.embedded` guard passes, and `dashboard.embedded[0]` blows up. #41195 only updated the `get_dashboard_info` mocks in `test_dashboard_tools.py`, not these.
   
   Fix is test-only: I set `embedded = []` on the shared `_mock_dashboard` builder so it matches the not-embedded production case. No production code changes; the guard in `schemas.py` is correct as-is. I checked the sibling tool tests and they don't reach this serializer line, so nothing else needed touching.
   
   References #41195.
   
   ### BEFORE/AFTER
   
   Before: `Python-Unit` red, 5 failures in `test_update_dashboard.py`.
   After: `pytest tests/unit_tests/mcp_service/dashboard/tool/` passes (117 passed locally).
   
   ### TESTING INSTRUCTIONS
   
   ```
   pytest tests/unit_tests/mcp_service/dashboard/tool/test_update_dashboard.py
   ```
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] 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
   - [x] Removes existing feature or API


-- 
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(mcp): set .embedded on update_dashboard test mocks [superset]

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

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/41499?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 55.76%. Comparing base ([`97cb002`](https://app.codecov.io/gh/apache/superset/commit/97cb002f46b3f168aaf9a4a92d634cee4f631551?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`d7f8c88`](https://app.codecov.io/gh/apache/superset/commit/d7f8c88b5379f793b744c4299bcfeac4d63e3165?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   > :exclamation:  There is a different number of reports uploaded between BASE (97cb002) and HEAD (d7f8c88). Click for more details.
   > 
   > <details><summary>HEAD has 58 uploads less than BASE</summary>
   >
   >| Flag | BASE (97cb002) | HEAD (d7f8c88) |
   >|------|------|------|
   >|python|50|1|
   >|presto|10|1|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #41499      +/-   ##
   ==========================================
   - Coverage   63.95%   55.76%   -8.19%     
   ==========================================
     Files        2664     2664              
     Lines      146223   146223              
     Branches    33733    33733              
   ==========================================
   - Hits        93514    81542   -11972     
   - Misses      50991    63941   +12950     
   + Partials     1718      740     -978     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/41499/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/41499/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/41499/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/41499/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/41499/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.80% <ø> (ø)` | |
   | [python](https://app.codecov.io/gh/apache/superset/pull/41499/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.80% <ø> (-17.45%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/41499/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/41499?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


Re: [PR] fix(mcp): set .embedded on update_dashboard test mocks [superset]

Posted by "hainenber (via GitHub)" <gi...@apache.org>.
hainenber closed pull request #41499: fix(mcp): set .embedded on update_dashboard test mocks
URL: https://github.com/apache/superset/pull/41499


-- 
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(mcp): set .embedded on update_dashboard test mocks [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #41499:
URL: https://github.com/apache/superset/pull/41499#issuecomment-4825115560

   Thanks! That makes TWO less PRs... a win in my book ;)


-- 
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(mcp): set .embedded on update_dashboard test mocks [superset]

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

   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(mcp): set .embedded on update_dashboard test mocks [superset]

Posted by "hainenber (via GitHub)" <gi...@apache.org>.
hainenber commented on PR #41499:
URL: https://github.com/apache/superset/pull/41499#issuecomment-4824749322

   I approved this and an earlier PR from @nytai. I'll be merging the former due to FIFO. Thanks Evan!


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