Repository navigation
feat(semantic layers): derive Explore picker modes from declared semantic view features - #42540
Conversation
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #42540 +/- ##
==========================================
+ Coverage 80.25% 80.33% +0.08%
==========================================
Files 2927 2934 +7
Lines 173166 173933 +767
Branches 40156 40221 +65
==========================================
+ Hits 138973 139735 +762
- Misses 31600 31604 +4
- Partials 2593 2594 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mikebridge
left a comment
There was a problem hiding this comment.
Checked whether the added extra="ignore" could blind the check. It cannot: UnknownFieldCheckMixin.check_unknown_fields is a @model_validator(mode="before"), so it inspects the raw input dict before pydantic applies extra. extra="ignore" only governs what pydantic does with fields that survive the validator, which runs first. I reproduced the exact mixin pattern standalone on pydantic 2.11.7 (the full app import chain isn't available in my env, so this is a faithful replica of the model shape, not the imported class): mixin + extra="ignore" raises on an unknown key identically to extra="allow", and valid input is unaffected. So the rejection fires as intended — not a no-op.
Completeness: every nested model used as an input field on the chart-config classes now inherits the mixin — ColumnRef, AxisConfig, LegendConfig, CurrencyFormat, FilterConfig, SortByConfig. I found no sibling nested config model left as a plain BaseModel (TimeGrain is an enum; AdhocFilter/DataColumn are output/parse-side models, not tool inputs).
Behavior: stricter contract — a key that pydantic's default extra="ignore" previously dropped silently now raises a ValidationError with a "did you mean?" hint. Those keys were already discarded (never used), so no well-formed caller regresses; a typo now surfaces instead of no-op'ing, which is the intent of #42626.
Note: #42628 targets the same fix by adding the mixin without an explicit extra="ignore" (relying on pydantic's default). This PR is the more explicit of the two; merging both would conflict on the same lines.
Tests: the new test_unknown_field_nested_one_level_down_is_rejected asserts directly on the nested AxisConfig (the model that got the mixin), not on a top-level extra="forbid" model, so it exercises the actual change. Reasoning about the revert: pre-fix AxisConfig is a plain BaseModel under pydantic's default extra="ignore", which I reproduced standalone drops the unknown key without raising — so reverting the production change makes this test fail by construction (I did not run the repo test suite in-env).
mikebridge
left a comment
There was a problem hiding this comment.
Review
Nicely scoped and well-tested overall — the ColumnPickerCapabilities adapter is a clean anti-corruption boundary, the CompatibilityResult discriminated union is a real improvement over the old null-means-everything encoding, and the #41456 expression=None invariant is protected with a regression assertion. Found two actionable correctness issues, both in new code from this PR.
1. Missing features on a provider crashes instead of degrading gracefully
superset-core/src/superset_core/semantic_layers/view.py:49:
class SemanticView(ABC):
features: frozenset[SemanticViewFeature]This is a bare type annotation, not a class attribute — it assigns no default. SemanticViewData.data then does:
"semantic_view_features": sorted(
feature.value for feature in self.implementation.features
),(superset/semantic_layers/models.py:378) with no getattr(..., frozenset()) fallback. Any provider implementation that doesn't explicitly set features = frozenset(...) will raise AttributeError when the Explore payload is built — not degrade to a Saved-only picker.
This directly contradicts the PR description's own framing ("a view that does not declare it gets a Saved-only picker") and the merge-coordination note at the top of the PR body: the Snowflake features declaration "has no PR yet" in the shell repo. As written, merging this alone won't silently degrade Snowflake's picker — it'll 500 on Explore for any Snowflake-backed semantic view until that companion declaration lands. Suggest either a default on the base class (features: frozenset[SemanticViewFeature] = frozenset()) or getattr(self.implementation, "features", frozenset()) at the call site, so an undeclared provider fails safe.
2. New "Dimensions and metrics" Saved dropdown filters metrics by the wrong compatibility list
superset-frontend/.../ColumnSelectPopover.tsx imports selectCompatibleDimensionNames but never selectCompatibleMetricNames, so compatibleMetrics doesn't exist in this file. In the new savedClassification branch that adds metrics to the combined Saved picker:
...(savedClassification
? availableMetrics.map(metric => ({
...
disabled:
compatibleDimensions != null &&
!compatibleDimensions.includes(metric.metric_name),
}))
: []),Metric options are gated on compatibleDimensions instead of compatibleMetrics. AdhocMetricEditPopover and DatasourcePanelDragOption both correctly use selectCompatibleMetricNames for this — this new call site should too. As-is, once a compatibility result is verified, a metric will be (dis)abled based on whether its name happens to appear in the dimensions list, which is wrong: e.g. dimensions: [] with a non-empty compatible-metrics list would disable every metric in this dropdown.
None of the new tests exercise this path with a verified compatibility state that actually constrains metrics (compatibility is left at the idle default in the "Cube saved metrics remain listed and selectable" test), so it slipped through.
(Note: there's a pre-existing instance of this same compatibleDimensions-for-metrics pattern in the untouched Simple-tab combined selector further down the file — out of scope here, but worth a follow-up since it looks like the same bug predates this PR.)
Everything else — capability derivation, tab-disabling/default-routing logic, the failed/verified/loading state machine, and the Save-button guard for legacy adhoc values — looks correct against the test coverage. Given the two issues above are in the exact code paths this PR introduces, I'd hold off requesting additional review until they're addressed.
Code Review Agent Run #422fe0Actionable Suggestions - 0Additional Suggestions - 1
Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
|
Mike, your own review here already nailed both bugs.
And in Neither's fixed in the commits since, just a CI retrigger. Want to push those before we take another pass on this? |
200fed8 to
cd3d36d
Compare
cd3d36d to
ec309d3
Compare
Code Review Agent Run #d7ba2eActionable Suggestions - 0Additional Suggestions - 15
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
7a32ea8 to
6b97959
Compare
|
Both pushed in
The three codeant threads were facets of bug 2 and are addressed by the same commit. Earlier commits since your review were the master rebase + antd-markup test fixes only. Ready for another pass whenever you are. |
Code Review Agent Run #cf4e7aActionable Suggestions - 0Additional Suggestions - 7
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
aminghadersohi
left a comment
There was a problem hiding this comment.
Reviewed at 4342bcae8929429208e4bf988c6d3488f708f6c7. Ran the frontend suites locally (pickerCapabilities, compatibility, exploreActions, exploreReducer, plus all of DndColumnSelectControl, DatasourcePanelDragOption, AdhocMetricEditPopover): 136 tests, all green.
The centralization is the right shape. Four things I specifically verified:
- Existing SqlaTable datasources are unaffected.
getColumnPickerCapabilitiesreturnsDEFAULT_CAPABILITIESfor anything that isn'tDatasourceType.SemanticView(pickerCapabilities.ts:61-63), so nothing changes for them. exploreActions.tsis a faithful refactor, not a removal. The −20 net lines are entirely the three flat fields (compatibleMetrics/compatibleDimensions/compatibilityLoading) collapsing into theCompatibilityResultunion. Every prior dispatch has a successor (null/null/false→idle,null/null/true→loading, populated →verified, error →failed), and bothrequestSeqstaleness guards survive. The union is a real improvement — "failed" and "verified but empty" were previously indistinguishable.- The duplicated
datasource.type === 'semantic_view'checks deleted fromDndColumnSelect.tsxandDndColumnMetricSelect.tsxare genuinely subsumed. Both capability branches include'sqlExpression'indisabledModes, so Custom SQL stays disabled for every semantic view exactly as before. - The new shared-package fields are optional (
semantic_view_features?: string[]on bothDatasetandDatasource), and the TS shape matches whatmodels.py:418-420emits (list[str]).
One defect: the Saved-only picker's clear button is inert
onSavedItemChange (ColumnSelectPopover.tsx:321-337) has no undefined branch. antd calls onChange(undefined) when the user clicks the clear affordance, and the select is explicitly allowClear (:576). Neither guard matches undefined, so the callback falls through and no state is reset.
This matters more than it normally would: in Saved-only mode Simple and Custom SQL are both disabled, so this select is the user's only control. It's a controlled input, so state never clears, the old value re-renders, and the × appears to do nothing.
The handler it replaces on that same select, onCalculatedColumnChange (:254-268), handles undefined correctly — find returns undefined, which resets column/metric/adhoc state and clears the label. So the two branches of one select at :571-575 disagree.
Verified locally: with semantic_view_features: [], picking a dimension calls setLabel('Product Category'); clicking the clear × produces zero subsequent calls.
Worth noting that the pre-existing onSimpleItemChange (:302-316) has the same gap, so this may be a known pattern rather than an oversight — but it becomes load-bearing here.
Minor, same function: calculatedColumns is tested before metricMap, so a dimension and a metric sharing a name resolve to the dimension.
Two questions
1. Are [] and absent meant to produce opposite pickers? !Array.isArray(features) || features.includes(...) (:66-67) means an absent key fails open (Simple enabled) while an empty array fails closed (Saved-only). Both are deliberate and documented, and since models.py now always emits the key, live semantic views land on the closed branch — so the behaviour you want is the behaviour you get today. I mainly want to confirm the intent, because the safety property rests entirely on that key never being omitted: any future payload path that drops it silently flips a Saved-only view to fully permissive, which is the exact outcome this PR exists to prevent.
2. Metrics are deliberately out of scope? AdhocMetricEditPopover reads compatibility but not capabilities, so on a Saved-only view a user still gets Simple and Custom SQL for metrics while columns are locked down. The feature name (ADHOC_COLUMN_EXPRESSIONS) and the docs ("a Saved-only column picker") both suggest that's intentional — flagging it only so it's an explicit decision rather than an inherited gap.
Hardening
sorted(feature.value for feature in self.implementation.features) (models.py:418-420) assumes every member is a SemanticViewFeature. A third-party provider that writes features = frozenset({"GROUP_LIMIT"}) — strings, plausible, and not type-checked outside this repo — raises AttributeError inside the data property and 500s Explore for that datasource. That inverts the "a new provider is safe by default" property the new docs promise. getattr(feature, "value", feature), or filtering on isinstance, would degrade instead of failing.
The docs addition matches the shipped behaviour, including the "unknown feature strings are ignored" claim (covered by pickerCapabilities.test.ts:47), and that suite covers the undeclared path directly — both the empty-list and absent-metadata cases — so a regression there would be caught.
CI
One experimental leg is red — playwright-tests-experimental (chromium) — but it died at step 6, "Setup Python", in run 33433466076, before any test executed. Its sibling matrix leg (chromium, /app/prefix), playwright-tests (chromium), and the required aggregator playwright-tests-required are all green. Not a code signal.
… capability contracts Serialize SemanticView.features as semantic_view_features in the explorable datasource payload (new opt-in SemanticViewFeature.ADHOC_COLUMN_EXPRESSIONS), translate it once through a provider-neutral ColumnPickerCapabilities adapter, and replace the overlapping compatibleMetrics/compatibleDimensions/ compatibilityLoading Redux fields with a discriminated CompatibilityResult (idle | loading | verified | failed) consumed through typed selectors. No provider identity crosses the wire; picker components consume capabilities only. Verified empty compatibility results are distinguishable from loading and failure; idle/loading/failed keep the existing no-filter fallback. Co-Authored-By: Claude Fable 5 <[email protected]>
…ility Address the two defects from review: - `SemanticView.features` on the superset_core ABC was a bare annotation, so `implementation.features` raised AttributeError for any provider that declared nothing, instead of degrading to the Saved-only picker. It now defaults to an empty frozenset on the class. - `ColumnSelectPopover` disabled saved-metric options and validated the Save action against the compatible *dimension* names; metric options are now keyed off `selectCompatibleMetricNames`, an incompatible selected metric blocks Save with its own message, and a semantic view with metrics but no dimensions still renders the Saved select. Tests: an adversarial fixture where the dimension list contains the other metric's name pins the metric/dimension split; a metrics-only view pins the render gate; a superset_core test pins the ABC default. Co-Authored-By: Claude Fable 5 <[email protected]>
4342bca to
cda4c56
Compare
…ialization Addresses Amin's review on apache#42540: - The Saved-only picker's clear (x) was inert: onSavedItemChange and onSimpleItemChange had no undefined branch, so antd's allowClear onChange(undefined) fell through and reset nothing. In Saved-only mode Simple and Custom SQL are disabled, making this the user's only reset control. Both handlers now route a cleared value through a shared resetSelection (mirroring onCalculatedColumnChange's reset). - SemanticView.data assumed every implementation.features member is a SemanticViewFeature; a provider returning a raw string would AttributeError and 500 Explore for that datasource. Use getattr(feature, 'value', feature) so it degrades and a new provider stays safe by default. Adds a regression test for each: clearing in Saved-only mode resets the selection, and a raw string feature serializes without erroring. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TQeAcprGvkFS8F3nghtvwv
…ialization Addresses Amin's review on apache#42540: - The Saved-only picker's clear (x) was inert: onSavedItemChange and onSimpleItemChange had no undefined branch, so antd's allowClear onChange(undefined) fell through and reset nothing. In Saved-only mode Simple and Custom SQL are disabled, making this the user's only reset control. Both handlers now route a cleared value through a shared resetSelection (mirroring onCalculatedColumnChange's reset). - SemanticView.data assumed every implementation.features member is a SemanticViewFeature; a provider returning a raw string would AttributeError and 500 Explore for that datasource. Use getattr(feature, 'value', feature) so it degrades and a new provider stays safe by default. Adds a regression test for each: clearing in Saved-only mode resets the selection, and a raw string feature serializes without erroring. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TQeAcprGvkFS8F3nghtvwv
8dd1e03 to
a174773
Compare
|
Thanks @aminghadersohi — thorough review. Both actionable items are fixed at head Defect — Saved-only clear × is inert. Fixed. Hardening — raw-string features 500 Explore. Fixed. Q1 — are Q2 — metrics deliberately out of scope? Yes, intentional. This PR scopes the capability lockdown to columns/dimensions; Minor — dimension-before-metric name collision. Left as-is: testing Re-requesting your review — thanks again. Reply generated by Claude (AI) on behalf of @mikebridge. |
Code Review Agent Run #9b65adActionable Suggestions - 0Additional Suggestions - 6
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
The inline getattr(feature, 'value', feature) tripped mypy in CI: with feature typed SemanticViewFeature, the typed getattr overload expects a str default, and the SemanticViewFeature fallback is rejected [arg-type]. Extract the coercion into _feature_value(feature: object) so getattr resolves to the generic overload; the helper also normalizes non-str values and names the provider-boundary intent. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TQeAcprGvkFS8F3nghtvwv
aminghadersohi
left a comment
There was a problem hiding this comment.
Round 2 review, scoped to the new commit 3f3126db (fix(semantic-layers): extract _feature_value helper to satisfy mypy) — +16/−6 in superset/semantic_layers/models.py. The other 28 files are untouched by this commit and were covered earlier. No blocking findings.
What I checked
- The behaviour change is real, and it is an improvement. The previous inline
getattr(feature, "value", feature)fedsorted()directly, so a provider returning a non-string alongside enum members raisedTypeError: '<' not supported between instances of 'int' and 'str'— i.e. a 500 out ofSemanticView.datafor that datasource. The newstr()normalization removes that failure mode. (Measured by evaluating the old and new expressions on the same mixed input.) - Fail-soft here is consistent with how the value is consumed.
getColumnPickerCapabilitiestreatssemantic_view_featuresas an allow-list (features.includes(ADHOC_COLUMN_EXPRESSIONS)), so a coerced junk value such as"7"falls through to the conservative Saved-only picker withshowCompatibilityFailure: truerather than silently enabling a capability. Fail-soft on serialize plus fail-closed on consume is the right pairing, and it lines up with thefrozenset()class default on theSemanticViewABC. feature: objectis an honest signature given the docstring's "raw string (or any object)" premise, and CI mypy is green on it. No objection.- Ran
tests/unit_tests/semantic_layers/models_test.py— 103 passed. The full check rollup on this head is green (60 success, netlify entries neutral/informational).
One optional nit — the newly added branch has no test
Reverting only the call site back to the pre-commit inline form leaves all 103 tests passing, so nothing currently distinguishes _feature_value from what it replaced. test_semantic_view_data_features_tolerates_raw_string covers the raw-string path, which both forms handle identically; the isinstance(value, str) → str(value) fallback, which is the behaviour this commit actually adds, is unexercised. A one-line variant with a non-string member — e.g. frozenset({SemanticViewFeature.GROUP_LIMIT, 7}) asserting ["7", "GROUP_LIMIT"] — would pin it, and would have gone red before this commit. Entirely your call; not a blocker.
…e_value
_feature_value's str(value) fallback (for a provider member that is neither a
SemanticViewFeature nor a string) had no test: reverting the call site to the
old inline getattr form left the whole suite green. Add a case with a non-string
member (frozenset({SemanticViewFeature.GROUP_LIMIT, 7})) asserting the serialized
payload is ["7", "GROUP_LIMIT"]. Verified: against the inline getattr form this
now fails with TypeError on the mixed-type sorted().
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TQeAcprGvkFS8F3nghtvwv
|
@aminghadersohi — added your optional test nit; the You were right that the non-string branch was unexercised — reverting the call site to the old inline Changed-file pre-commit clean (ruff/ruff-format/mypy). Your earlier approve went stale when the mypy Reply generated by Claude (AI) on behalf of @mikebridge. |
Code Review Agent Run #abd00aActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
aminghadersohi
left a comment
There was a problem hiding this comment.
Round 3, scoped to the one new commit 4a8c44af75 — +15/−0 in tests/unit_tests/semantic_layers/models_test.py, nothing else touched. The nit from my last round is closed, and I verified the control independently rather than taking the commit message for it.
Revert-the-guard check (the thing that matters for a coverage commit)
I removed only the coercion from _feature_value — return value if isinstance(value, str) else str(value) → return value, leaving the getattr passthrough intact, so this deletes the guard rather than the function:
- at head:
104 passed - with the coercion removed:
1 failed, 103 passed, and the single failure istest_semantic_view_data_features_coerces_non_string_member, raisingTypeError: '<' not supported between instances of 'int' and 'str'atmodels.py:601
So the new test is the only test in the file that discriminates, and it fails for exactly the right reason — the mixed-type comparison inside sorted(), which is the real-world 500 this guard exists to prevent. That is what the previous round could not say: the old suite stayed fully green with the guard gone.
Two things I'd call out as the right shape, briefly:
- It asserts a value (
== ["7", "GROUP_LIMIT"]), not merely that nothing raised. A no-raise assertion would technically have discriminated here, but the value form also pins the sort order and thestr()rendering, so it stays honest if the coercion is ever changed to something that doesn't throw. - It appends a case alongside
..._tolerates_raw_string— no existing fixture edited, no assertion relaxed. That's affirmative evidence the code was covered rather than the suite bent to fit.
tests/unit_tests/semantic_layers/models_test.py: 104 passed at head. Full check rollup on 4a8c44af75 is clean — 66 legs deduped to the newest run per name, zero failure/timed_out (60 success, 3 neutral netlify/informational, 3 skipped).
On the re-approval request — I can't take that one. This pipeline doesn't approve external contributions, so my review here is a comment regardless of how the code reads, and the earlier approve at 86347307f9 no longer covers the head. Nothing further from me on the Python side: the remaining gate is a sign-off from one of the requested core committers (@michael-s-molina, @villebro, @geido, @eschutho, @rusackas, @kgabryje). Thanks for turning the nit around so precisely.
Three independent collisions, resolved as follows. 1. Compatibility state. Master carries two designs for the same feature: the flat explore.compatibleMetrics/compatibleDimensions fields (apache#37815) and useDatasourceCompatibility, extracted from them in apache#42483 for folder drag sources. This branch replaces the flat fields with a discriminated CompatibilityResult, so after the merge nothing writes them and the hook would read undefined forever -- silently disabling folder-level filtering in DatasourcePanelItem, which this branch never touches. The hook is therefore re-sourced from this branch's selectors with its signature unchanged, so its callers need no edit, and the two DatasourcePanelItem tests that seeded the flat shape are migrated to the new one. 2. Portal timing. Master's antd renders the Select option list into a portal on a later tick, so this branch's synchronous document.querySelector('.ant-select-dropdown-list') reads race it and find null. Reads now go through an awaited getDropdown() accessor, and the post-save onChange assertions are wrapped in waitFor for the same reason. 3. Test files. DndColumnSelect, DndColumnMetricSelect and AdhocFilterEditPopoverSimpleTabContent are both-sides-append conflicts, resolved as the union of both sets. DatasourcePanelDragOption keeps this branch's two tests: master's single test asserts against the flat field that no longer exists. AdhocFilterEditPopoverSimpleTabContent still has 12 failures, but the same 12 fail on untouched master; the merge adds none. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01EA4MGEkUcDpyLReqjQBhPy
aminghadersohi
left a comment
There was a problem hiding this comment.
Re-checked at b175ac0153f8: the only author change since 4a8c44af75 is rewiring useDatasourceCompatibility onto this PR's selectors after master's folder-DnD work landed a file at that path, which I verified behaviour-equivalent. No new findings — the remaining gate is a committer sign-off.
richardfogaca
left a comment
There was a problem hiding this comment.
Richard's agent here: one blocking finding at b175ac0.
P2 — Existing Simple-only callers end up with no usable picker mode. In ColumnSelectPopover.tsx:367–394, a semantic datasource with semantic_view_features: [] disables simple and sqlExpression. The Histogram Column control and DeckGL Tooltip contents already pass disabledTabs: new Set(['saved', 'sqlExpression']). Their union disables all three modes: Saved is omitted, Simple is disabled, and the dimensions have moved out of Simple. Users cannot select dimensions through these pickers; the Saved metric options are also unreachable in the DeckGL picker.
Could we reconcile these callers' restrictions with semantic dimensions moving to Saved, preserving a usable selection mode without enabling unsupported expressions, and add regression tests using their actual disabledTabs values?
The tab-selection logic was reproduced with those caller inputs (no enabled modes; fallback key simple), but not in a rendered browser. Current CI is passing. Withholding approval pending this caller-integration fix.
Reconcile PR apache#42540 review: caller restrictions on Saved exclude calculated expressions, not semantic dimensions and metrics. Ignore that caller restriction only for Saved-classified datasources while preserving provider-disabled modes. Do not enable Simple or SQL expressions to recover a selection mode. Remove the disabled-tab fallback: configurations with no enabled mode show explicit feedback and Close instead of a disabled active tab or Save. Cover actual Histogram and DeckGL restrictions, metric reachability, and unchanged expression-classified behavior. Production-revert control failed three tests; restoration passed all 137 tests in 11 suites. Pre-commit passed except for the explicitly permitted clone TS6305 missing package declaration builds; no other diagnostic surfaced in captured hook output.
|
Thanks — reproduced this before fixing it, and the composition is exactly as described: the caller set Fixed in The reconciliation. A caller's I considered relaxing the semantic restriction on The independent bug. Regression uses the callers' actual Good catch — the union only bites with those specific caller values, which is why the existing tests missed it. |
Code Review Agent Run #4abf12Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
richardfogaca
left a comment
There was a problem hiding this comment.
Richard's agent here: re-reviewed the fix at e7af87697a; the prior P2 is resolved. Histogram/DeckGL callers now retain Saved selection without enabling unsupported Simple/Custom SQL modes, and provider restrictions remain respected. The regression tests cover the actual caller restrictions and dimension selection/save; the no-mode case now shows feedback rather than selecting a disabled tab. No new substantive findings in the delta.
Current CI has no failing or pending checks. Independent local validation covered six extracted-logic cases, not rendered component tests or live provider UI. The separately documented Snowflake deployment coordination remains outside this approval's verification scope. Thanks for addressing this.
aminghadersohi
left a comment
There was a problem hiding this comment.
Re-derived at e7af87697a: the Saved override is scoped to saved-classified semantic views, so Simple-only callers on tables and adhoc-capable views keep their restrictions unchanged. No findings — reverting any of the three production changes reds a corresponding test.
rusackas
left a comment
There was a problem hiding this comment.
@mikebridge this has been through a lot of rounds now, and it all landed clean: the feature-default bug, the metric-keyed compatibility fix, and the Histogram/DeckGL tab reconciliation. CI's green and I don't see anything new to flag. LGTM, thanks for sticking with this one through all the review passes!
SUMMARY
Semantic-view providers can now declare what their backend supports, and the Explore column picker adapts its modes and dimension classification to that declaration instead of guessing from column metadata.
A note on the originating report. The internal story behind this describes the "Columns and metrics" picker showing
0 item(s)for a Cube-backed semantic view, and that literal symptom no longer reproduces on master. Reproduced against a live Cube instance through the real model path: dimensions arrive withexpression=None, so the picker's expression-based split routes all four into Simple, not zero.The empty picker came from the pre-#41456 payload, which set
expression=dimension.definition. BecauseColumnSelectPopovertreats any column with a truthyexpressionas a Saved/calculated column, every dimension landed under Saved and Simple rendered0 item(s). #41456 (e28b259de0) flipped that field toNoneso temporal dimensions keep their time-grain affordance — and the dimensions moved into Simple.That fixed the emptiness but landed them in the wrong mode. The behavior agreed with design at the time was: dimensions and metrics presented under Saved, with Simple and Custom SQL disabled, because a semantic view whose backend cannot execute adhoc column expressions should not offer modes that compose them. The "disable Simple" half was never implemented, and #41456 additionally moved dimensions out of Saved. This PR implements that intent — generalized so it is driven by what a provider declares rather than by which provider it is:
1. Providers declare features; Explore consumes capabilities. A new opt-in
SemanticViewFeature.ADHOC_COLUMN_EXPRESSIONSmarks views whose backend accepts simple/custom-SQL column expressions. The declared set serializes to the datasource payload assemantic_view_features. A view that does not declare it gets a Saved-only picker: dimensions listed as Saved options, Simple and Custom SQL visible but disabled, so users cannot compose an expression the backend would reject.Polarity is opt-in to match the existing provider convention — Snowflake declares its features, Cube and MetricFlow deliberately ship
frozenset(). A companion one-line declaration onSnowflakeSemanticViewkeeps Snowflake's picker behavior unchanged and ships separately in the shell repo.Provider identity is deliberately not sent over the wire. The
@semantic_layerdecorator prefixes extension IDs (extensions.preset-io.cube-semantic-layer.cube), so there is no stable bare registry key to publish, and behavior keyed off provider identity would not survive that prefixing. Features are translated exactly once, inutils/pickerCapabilities.ts, into a provider-neutralColumnPickerCapabilities. Picker components consume capabilities and never read feature strings, registry keys, or display names. Two DnD wrappers that each carried their own copy of the "semantic views disable Custom SQL" rule now defer to that adapter.2. Compatibility request state was conflated (a real defect).
fetchCompatibilitydispatched an identical{compatibleMetrics: null, compatibleDimensions: null, compatibilityLoading: false}both when the datasource is non-semantic and when the request failed. A failed compatibility lookup was therefore indistinguishable from "no filtering applies", so no UI could ever surface it. That state is now a discriminatedCompatibilityResult(idle | loading | verified | failed) read through typed selectors, and every existing consumer — column picker, datasource-panel drag options, adhoc metric popover — was migrated in the same change so the replacement cannot strand an old reader. Idle, loading, and failed keep the existing no-filter fallback; averifiedempty result is a valid "nothing is compatible" answer, not a fallback;failedadditionally shows an accessible non-blocking warning where the capability enables it.Incompatible or legacy adhoc values can no longer be silently committed: Saved becomes the active mode, the legacy value stays inspectable under Custom SQL, and Save is disabled with accessible corrective feedback associated to it until the user explicitly picks a compatible dimension.
expression=Noneon semantic dimensions is preserved throughout — #41456's time-grain behavior is a protected invariant here, not a cleanup opportunity, and there is a regression assertion to that effect.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not included: rendering a Cube-backed semantic view requires the proprietary provider extension, which is not installable in an OSS checkout. Behavior is covered by component tests that drive the real picker, and by a local reproduction against a Cube instance described below.
TESTING INSTRUCTIONS
Automated (no provider extension needed):
Manual, with a semantic-layer provider available:
ADHOC_COLUMN_EXPRESSIONS(and on a plain table dataset): modes, defaults, search, and Save are unchanged.The
0 item(s)claim above was verified against the Cube fixture indb-infra/databases/cube(REST API on:4000) using a throwaway provider stub overSemanticView.data; the stub is not part of this PR.ADDITIONAL INFORMATION
Backwards compatible:
semantic_view_featuresis additive and optional. Payloads without it, unknown feature strings, and non-semantic datasources all resolve to existing behavior, so noUPDATING.mdentry is needed.🤖 Generated with Claude Code