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

   ### SUMMARY
   
   Semantic views with a raw date dimension can reject day, week, month, 
quarter, or year grouping with an HTTP 500. The host correctly rejects the 
request because the dimension advertises no grain variants, but it raised a 
plain `ValueError`.
   
   - `_validate_granularity` now raises the existing 
`QueryObjectValidationError` with the same message, so unsupported grains 
return HTTP 400 from chart-data before any provider query runs.
   - Queries with no grain continue to work as before.
   - This change does not add provider grain support, and no other `ValueError` 
is altered.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A (API behavior). Before: an unsupported grain on a raw date dimension 
returns HTTP 500. After: HTTP 400 with the same message. A request with no 
grain still returns HTTP 200.
   
   ### TESTING INSTRUCTIONS
   
   With the semantic layer feature enabled, run the new chart-data grain 
validation test and the mapper tests under `tests/unit_tests/semantic_layers`. 
They exercise the chart-data route with a mocked raw date provider for each of 
the day, week, month, quarter, and year grains (expecting 400) and for no grain 
(expecting 200). The regression tests fail without the change. Semantic-layer 
coverage (707 tests) and SQL coverage (2304 tests) both pass at 100%, and 
changed-file hooks and mapper Pylint pass.
   
   The whole unit suite was left to CI. Live provider validation was not 
available; a mocked raw date provider covers the host error boundary only.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue
   - [ ] Required feature flags
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to