Repository navigation
Conversation
…ttm_col for time-range parent cascade
Code Review Agent Run #89855eActionable 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 |
|
Yes, the suggestion is valid — the race condition can occur when multiple FilterValue components mount simultaneously, each dispatching fetchDatasourceMetadata without deduplication, leading to duplicate API requests. To resolve this, modify the fetchDatasourceMetadata thunk in src/dashboard/actions/datasources.ts to track in-flight requests using a module-level Map. There are no other comments on this PR. superset-frontend/src/dashboard/actions/datasources.ts |
…quests When multiple FilterValue components share the same datasetId and mount simultaneously, each sees an empty Redux cache and dispatches fetchDatasourceMetadata. The thunk already short-circuits once the datasource is cached, but has no guard for concurrent in-flight requests. Add a module-level Set to track keys currently being fetched so that parallel dispatches for the same key skip the network call. The Set entry is cleared on both success and error so a failed request can be retried. Addresses review feedback on the FilterValue granularity_sqla fix. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Code Review Agent Run #e7c400Actionable 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 |
|
Prettier is failing on The (The playwright/cypress reds look like the usual flaky export/delete suites, not your change — don't sweat those.) |
Address review feedback on the time-range parent cascade fix: - Remove the `state.datasources as Record<string, any>` cast in FilterValue; state.datasources is already typed as DatasourcesState, so main_dttm_col resolves to string | undefined without `any`. - Extract the granularity_sqla resolution into the pure, exported resolveGranularitySqla() helper and cover the cascade cases (own value wins, main_dttm_col fallback, no-dependency, no-dttm). - Add datasources.test.ts covering the in-flight dedup Set: cache hit short-circuit, single fetch, concurrent de-duplication, and key cleanup after a failed request so it can retry. - Re-run prettier on FilterValue.tsx to fix the failing format check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thanks for the review @rusackas! Addressed in 010f053:
The bot's dedup suggestion was already implemented in b582c8a (the in-flight |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review Agent Run #8b6135Actionable 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 |
…ests Address follow-up review feedback: - FilterValue: the mount-time fetchDatasourceMetadata dispatch returns a promise that can reject (the thunk re-throws to clear its in-flight guard). Wrap the dispatch and log on failure so a failed best-effort cache prime can't surface as an unhandled promise rejection. The fetch is non-fatal, so the filter still works without the cascade fallback. - datasources.test.ts: replace the `any` casts (state helper, cached datasource fixture, and SupersetClient.get response mocks) with proper types (DatasourcesState, Datasource, and the client's resolved response type), honoring the repo's no-`any` rule for changed TypeScript. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Code Review Agent Run #91dcd4Actionable 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 |
|
| Language | Fuzzy before | Fuzzy after | New |
|---|---|---|---|
fr |
1004 | 1014 | +10 |
How to fix
1. Install dependencies (if not already set up):
pip install -r superset/translations/requirements.txt
sudo apt-get install gettext # or: brew install gettext2. Re-extract strings and sync .po files:
./scripts/translations/babel_update.shThis rewrites superset/translations/messages.pot from the current source files and merges the changes into every .po file. Strings whose msgid changed will be marked #, fuzzy.
3. Resolve the fuzzy entries in the affected language files (fr):
grep -n '#, fuzzy' superset/translations/<lang>/LC_MESSAGES/messages.poFor each fuzzy entry, either rewrite the msgstr to match the new string and remove the #, fuzzy line, or clear the msgstr to "" if you cannot provide a translation.
4. Commit your changes to the .po files.
…ranularity-sqla-cascade # Conflicts: # superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx
|
Resolved by merging latest |
Address review feedback on the dedup guard. The Set-based guard returned `undefined` to concurrent duplicate callers, which breaks the thunk contract: a caller awaiting the dispatch (e.g. the Promise.all over addChart + fetchDatasourceMetadata in addSliceToDashboard) would resolve early without the metadata and could not observe a rejection. Replace the Set with a per-key Map of in-flight promises and return the same promise to every concurrent caller, so completion and errors propagate consistently. Cleanup moves to `.finally` (runs on both success and failure). Add tests asserting concurrent callers share one promise and that a rejection propagates to all of them. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR). 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 |
Resolve conflicts with master and address review feedback: - fetchDatasourceMetadata: keep master's semantic-refresh path (dashboardId) and its new endpoint; apply the shared in-flight promise only to plain metadata loads; guard a missing datasources slice (datasources?.[key]). - FilterValue: drop the applyTimeGrainAllowlist helper that master removed (apache#40000); only fetch dataset metadata when a time_range parent cascades, the filter has no granularity_sqla of its own, the dataset is a table and it is not already cached, so cache hits no longer dispatch setDatasource and remint state.datasources; catch synchronous throws from the dispatch. - Move the resolveGranularitySqla tests to FilterValue.granularitySqla.test.ts (master deleted FilterValue.timeGrain.test.ts) and add FilterValue tests for the cascade fallback and the metadata fetch gating. Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #39894 +/- ##
==========================================
+ Coverage 85.65% 85.67% +0.01%
==========================================
Files 3108 3111 +3
Lines 214739 214965 +226
Branches 50791 50923 +132
==========================================
+ Hits 183927 184161 +234
+ Misses 27393 27385 -8
Partials 3419 3419
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:
|
SUMMARY
When a native Date Range filter is configured as the parent of a Select (Value)
filter, the child filter's dropdown values should be constrained to the selected
date range. This has never worked correctly due to three bugs in
FilterValue.tsx:Bug 1 — Missing
granularity_sqla:getFormDatasends the parent'stime_rangeviaextra_form_datato the child's column-values API request, butsends no
granularity_sqla. The backend receives the temporal constraint but hasno column to apply it to and silently returns all values. Upstream PR #34137 fixed
the timing (child requests now wait for parent values) but did not address the
missing column.
Bug 2 — Datasource not in Redux cache: The fix for Bug 1 reads
main_dttm_colfrom
state.datasources, but/api/v1/dashboard/:id/datasetsonly returns datasetsused by chart slices. Native-filter-only datasets are never in
state.datasources.fetchDatasourceMetadatais now dispatched at mount time to populate the cache forthose datasets.
Bug 3 — Stale React closure:
datasourceMainDttmColwas not in the mainuseEffectdependency array. Filters with a default date range would fire theireffect before the async fetch completed and never re-run once the datasource loaded.
Changes
FilterValue.tsx: importfetchDatasourceMetadataFilterValue.tsx: dispatchfetchDatasourceMetadataat mount whendatasetIdisset, populating
state.datasourcesfor filter-only datasetsFilterValue.tsx: readmain_dttm_colfrom the cache viauseSelectorand use itas a fallback
granularity_sqlawhendependencies.time_rangeis setFilterValue.tsx: adddatasourceMainDttmColto the mainuseEffectdep arrayTESTING INSTRUCTIONS
main_dttm_col(e.g.birth_names), with the Time range filter set as its parentmatching options
ADDITIONAL INFORMATION