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/15 17:53:36 UTC
[PR] test(mcp): fix update_chart test patching the re-exported function, unbreaking master [superset]
rusackas opened a new pull request, #41064:
URL: https://github.com/apache/superset/pull/41064
### SUMMARY
`Python-Unit` has been failing on every master commit since #40853 merged (June 12). A single test, `test_dataset_id_passed_to_update_command`, patches `_validate_update_against_dataset` via a string path:
```python
@patch("superset.mcp_service.chart.tool.update_chart._validate_update_against_dataset", ...)
```
Because `superset/mcp_service/chart/tool/__init__.py` re-exports the `update_chart` **function**, `mock`'s importer resolves `...tool.update_chart` to the function rather than the submodule and raises:
```
AttributeError: <function update_chart> does not have the attribute '_validate_update_against_dataset'
```
This fails deterministically (reproducible in isolation), which is why master has been solidly red rather than intermittently flaky.
The other three patches of the same symbol in this file already use `patch.object(update_chart_module, ...)` — there's even a comment near the top of the file (the `update_chart_module = importlib.import_module(...)` block) explaining this exact trap. This one decorator just missed the pattern. The fix aligns it with the rest of the file.
### TESTING INSTRUCTIONS
```bash
# Fails on master, passes with this change:
pytest "tests/unit_tests/mcp_service/chart/tool/test_update_chart.py::TestUpdateChartDatasetIdIntegration::test_dataset_id_passed_to_update_command"
# Whole file:
pytest tests/unit_tests/mcp_service/chart/tool/test_update_chart.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
- [ ] 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] test(mcp): fix update_chart test patching the re-exported function, unbreaking master [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #41064:
URL: https://github.com/apache/superset/pull/41064#issuecomment-4710960336
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/41064?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 63.68%. Comparing base ([`11e35ec`](https://app.codecov.io/gh/apache/superset/commit/11e35eca3b89397a3ec15e2a413a2fe9facbc83d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`7f7bc21`](https://app.codecov.io/gh/apache/superset/commit/7f7bc21c8c3cc7b43711f0a65f252e4d8c49d77a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #41064 +/- ##
==========================================
+ Coverage 55.59% 63.68% +8.09%
==========================================
Files 2660 2660
Lines 144711 144711
Branches 33371 33371
==========================================
+ Hits 80454 92164 +11710
+ Misses 63532 50898 -12634
- Partials 725 1649 +924
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/41064/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/41064/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `39.36% <ø> (ø)` | |
| [postgres](https://app.codecov.io/gh/apache/superset/pull/41064/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `58.17% <ø> (?)` | |
| [presto](https://app.codecov.io/gh/apache/superset/pull/41064/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.94% <ø> (ø)` | |
| [python](https://app.codecov.io/gh/apache/superset/pull/41064/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `58.35% <ø> (+17.34%)` | :arrow_up: |
| [sqlite](https://app.codecov.io/gh/apache/superset/pull/41064/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.79% <ø> (?)` | |
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/41064?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] test(mcp): fix update_chart test patching the re-exported function, unbreaking master [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #41064:
URL: https://github.com/apache/superset/pull/41064#issuecomment-4710768863
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] test(mcp): fix update_chart test patching the re-exported function, unbreaking master [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #41064:
URL: https://github.com/apache/superset/pull/41064#issuecomment-4795083708
Looks like this exact fix already landed on master via #41310, so after a rebase this comes up empty. Closing as superseded.
--
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] test(mcp): fix update_chart test patching the re-exported function, unbreaking master [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed pull request #41064: test(mcp): fix update_chart test patching the re-exported function, unbreaking master
URL: https://github.com/apache/superset/pull/41064
--
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