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/22 01:20:54 UTC

[PR] test(sqllab): cover ClickHouse query error propagation [superset]

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

   ### SUMMARY
   Adds test coverage for what SQL Lab shows when a ClickHouse query fails: the server's own error (code, exception name, offending identifier) should reach `Query.error_message`, `Query.extra["errors"]` and the returned payload, instead of being dropped or replaced by a generic message. Nothing in this area was tested for ClickHouse before; the existing ClickHouse engine-spec tests only cover successful queries.
   
   No production code changes.
   
   - `tests/unit_tests/sql_lab_clickhouse_errors_test.py` drives `execute_sql_statements` and `get_sql_results` with the real `ClickHouseConnectEngineSpec` and a stand-in DB-API cursor that raises the exception `clickhouse-connect` raises for a server error. It covers a failure at `execute`, a failure while fetching rows, the "Block N out of M" prefix on a multi-statement failure, and the generic-message case below.
   - `tests/testcontainers/db_engine_specs/test_clickhouse.py` runs failing statements (unknown table, unknown column, syntax error, failing cast, and a runtime error thrown millions of rows into a result) against a real ClickHouse server through `execute_with_cursor`, then checks `extract_error_message` and `extract_errors`.
   
   One test is a characterization, not a guarantee of desired behavior: with `show_clickhouse_errors=false` in the connection URI, `clickhouse-connect` itself withholds the server's text and raises only "The ClickHouse server returned an error", so that is all SQL Lab can show. The test pins that current behavior.
   
   Note: `clickhouse-connect` reads the full response inside `cursor.execute`, so a failure in the later `fetch_data` step cannot be provoked against a real server; that step is covered only with the stand-in cursor.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   Not applicable (tests only, no UI change).
   
   ### TESTING INSTRUCTIONS
   Unit tests:
   `pytest tests/unit_tests/sql_lab_clickhouse_errors_test.py tests/unit_tests/sql_lab_test.py tests/unit_tests/db_engine_specs/test_clickhouse.py`
   
   Real-server tests (need Docker for the testcontainers ClickHouse image):
   `pytest tests/testcontainers/db_engine_specs/test_clickhouse.py -m testcontainers`
   
   The author ran the unit tests (204 passed) and ran the testcontainers module against a locally started ClickHouse 26.11.1 server in place of the container (9 passed), because Docker was not available; the container fixture path itself is exercised by CI. Each new test was also confirmed to fail when the error handling in `sql_lab.py`, `sql/execution/utils.py` or the ClickHouse engine spec was deliberately changed to drop the message.
   
   ### 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
   


-- 
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(sqllab): cover ClickHouse query error propagation [superset]

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

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | 25b44de0e6bf6694d19c6cd08cee32064eb99123 |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6ae23db784272da244800559 |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-45596--superset-docs-preview.netlify.app](https://deploy-preview-45596--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQ1NTk2LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.i1OnBFsjW1t3qFGDGmvCcnFDS6NjhrlqKuOsIKNksVM)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DcvLDYAgDADQXXqWxCB-N3CMAo0a0WLBgzHuLrd3eS9E4SNmmAAqsIKnW4szpaxc2Ny-8p1IpSsEtIpEWFQZERfMG5_leIqBn9mX1SHpxtt-MLrXHrUxQ1237QjfDw) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-45596--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
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(sqllab): cover ClickHouse query error propagation [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #45596:
URL: https://github.com/apache/superset/pull/45596#issuecomment-6344834675

   ## CodeAnt PR Risk: Low Risk
   
   - The PR appears safe to merge; no actionable issues were identified in the review.
   
   **Assessed commit:** `731f665e3b8f`


-- 
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(sqllab): cover ClickHouse query error propagation [superset]

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

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/45596?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 65.39%. Comparing base ([`4bfd874`](https://app.codecov.io/gh/apache/superset/commit/4bfd874c4cbb39a52e8c1769414c78d9c45d5bb7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`731f665`](https://app.codecov.io/gh/apache/superset/commit/731f665e3b8fd67730b575a995cf6517b8f2e059?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 (4bfd874) and HEAD (731f665). Click for more details.
   > 
   > <details><summary>HEAD has 4 uploads less than BASE</summary>
   >
   >| Flag | BASE (4bfd874) | HEAD (731f665) |
   >|------|------|------|
   >|python|7|3|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #45596       +/-   ##
   ===========================================
   - Coverage   84.10%   65.39%   -18.72%     
   ===========================================
     Files        3056     3056               
     Lines      201280   201285        +5     
     Branches    47064    47066        +2     
   ===========================================
   - Hits       169292   131626    -37666     
   - Misses      28748    66693    +37945     
   + Partials     3240     2966      -274     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/45596/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/45596/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `34.89% <ø> (-0.01%)` | :arrow_down: |
   | [mysql](https://app.codecov.io/gh/apache/superset/pull/45596/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `52.85% <ø> (-0.01%)` | :arrow_down: |
   | [postgres](https://app.codecov.io/gh/apache/superset/pull/45596/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/45596/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `36.62% <ø> (-0.01%)` | :arrow_down: |
   | [python](https://app.codecov.io/gh/apache/superset/pull/45596/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `52.93% <ø> (-34.42%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/45596/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/45596/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/45596?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(sqllab): cover ClickHouse query error propagation [superset]

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


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