You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "jtjenkins (via GitHub)" <gi...@apache.org> on 2026/05/05 17:59:58 UTC
[PR] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
jtjenkins opened a new pull request, #39894:
URL: https://github.com/apache/superset/pull/39894
### 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`:** `getFormData` sends the parent's
`time_range` via `extra_form_data` to the child's column-values API request, but
sends no `granularity_sqla`. The backend receives the temporal constraint but has
no 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_col`
from `state.datasources`, but `/api/v1/dashboard/:id/datasets` only returns datasets
used by chart *slices*. Native-filter-only datasets are never in `state.datasources`.
`fetchDatasourceMetadata` is now dispatched at mount time to populate the cache for
those datasets.
**Bug 3 — Stale React closure:** `datasourceMainDttmCol` was not in the main
`useEffect` dependency array. Filters with a default date range would fire their
effect before the async fetch completed and never re-run once the datasource loaded.
### Changes
- `FilterValue.tsx`: import `fetchDatasourceMetadata`
- `FilterValue.tsx`: dispatch `fetchDatasourceMetadata` at mount when `datasetId` is
set, populating `state.datasources` for filter-only datasets
- `FilterValue.tsx`: read `main_dttm_col` from the cache via `useSelector` and use it
as a fallback `granularity_sqla` when `dependencies.time_range` is set
- `FilterValue.tsx`: add `datasourceMainDttmCol` to the main `useEffect` dep array
### TESTING INSTRUCTIONS
1. Create a dashboard with **no charts** (so no datasets are loaded via the slice API)
2. Add a **Time range** native filter (parent)
3. Add a **Value** native filter targeting a dataset that has a `main_dttm_col` (e.g.
`birth_names`), with the Time range filter set as its parent
4. Without a date range set: the Value filter shows all options
5. Set a date range that contains no data in the dataset: Value filter shows "No data"
6. Set a date range that contains a subset of the data: Value filter shows only the
matching options
7. Clear the date range: Value filter restores all options
### ADDITIONAL INFORMATION
- Related issues: #24340 (time-range dependent filter cascading limitation)
- No feature flags needed
- No database migrations
- No UI-visible changes (behaviour fix only)
--
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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39894:
URL: https://github.com/apache/superset/pull/39894#issuecomment-4383053869
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers a full AI review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "DamianPendrak (via GitHub)" <gi...@apache.org>.
DamianPendrak commented on code in PR #39894:
URL: https://github.com/apache/superset/pull/39894#discussion_r3559367347
##########
superset-frontend/src/dashboard/actions/datasources.ts:
##########
Review Comment:
tests fail without a `datasources?.[key]` guard here
##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx:
##########
@@ -187,6 +203,35 @@ const FilterValue: FC<FilterValueProps> = ({
const [isRefreshing, setIsRefreshing] = useState(false);
const dispatch = useDispatch();
+ // When a Date Range parent filter is active, the child filter needs
+ // granularity_sqla to apply the temporal WHERE clause. Read main_dttm_col
+ // from the Redux datasource cache as a fallback.
+ //
+ // The dashboard datasets API (/api/v1/dashboard/:id/datasets) only returns
+ // datasets used by chart slices, so native-filter-only datasets are never
+ // in state.datasources. Dispatch fetchDatasourceMetadata at mount time to
+ // populate the cache explicitly for those datasets.
+ const datasourceMainDttmCol = useSelector<RootState, string | undefined>(
+ state =>
+ datasetId != null
+ ? state.datasources?.[`${datasetId}__table`]?.main_dttm_col
+ : undefined,
+ );
+
+ useEffect(() => {
+ if (datasetId != null) {
+ // Best-effort prime of the datasource cache for the granularity_sqla
+ // fallback. A failure here is non-fatal — the filter still works, just
+ // without the time-range cascade fallback — so handle the rejection
+ // explicitly to avoid an unhandled promise rejection.
+ Promise.resolve(
+ dispatch(fetchDatasourceMetadata(`${datasetId}__table`)),
+ ).catch(error =>
+ logging.warn('Failed to fetch filter datasource metadata', error),
+ );
+ }
+ }, [datasetId, dispatch]);
Review Comment:
Non-blocking: On cache hits, `setDatasource` still fires and the reducer mints a new `state.datasources` reference for an unchanged value (datasources.ts:35-40, no equality check), re-rendering every `FiltersBadge` and recomputing `chartsVerboseMapSelector`. We could check the cache first and only fetch datasets that aren't already loaded.
--
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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39894:
URL: https://github.com/apache/superset/pull/39894#issuecomment-4802445017
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers a full AI review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39894:
URL: https://github.com/apache/superset/pull/39894#issuecomment-4783499315
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers a full AI review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "jtjenkins (via GitHub)" <gi...@apache.org>.
jtjenkins commented on code in PR #39894:
URL: https://github.com/apache/superset/pull/39894#discussion_r3461888585
##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx:
##########
@@ -185,6 +200,27 @@ const FilterValue: FC<FilterValueProps> = ({
const [isRefreshing, setIsRefreshing] = useState(false);
const dispatch = useDispatch();
+ // When a Date Range parent filter is active, the child filter needs
+ // granularity_sqla to apply the temporal WHERE clause. Read main_dttm_col
+ // from the Redux datasource cache as a fallback.
+ //
+ // The dashboard datasets API (/api/v1/dashboard/:id/datasets) only returns
+ // datasets used by chart slices, so native-filter-only datasets are never
+ // in state.datasources. Dispatch fetchDatasourceMetadata at mount time to
+ // populate the cache explicitly for those datasets.
+ const datasourceMainDttmCol = useSelector<RootState, string | undefined>(
+ state =>
+ datasetId != null
+ ? state.datasources?.[`${datasetId}__table`]?.main_dttm_col
+ : undefined,
+ );
+
+ useEffect(() => {
+ if (datasetId != null) {
+ dispatch(fetchDatasourceMetadata(`${datasetId}__table`));
Review Comment:
Fixed in 3c99fa2. The thunk re-throws to clear its in-flight guard, so the dispatched promise can reject. Wrapped the dispatch in `Promise.resolve(...).catch(...)` and log via `logging.warn` — the metadata fetch is a best-effort cache prime for the granularity_sqla fallback, so a failure is non-fatal but no longer surfaces as an unhandled rejection.
##########
superset-frontend/src/dashboard/actions/datasources.test.ts:
##########
@@ -0,0 +1,105 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { SupersetClient } from '@superset-ui/core';
+import { RootState } from 'src/dashboard/types';
+import {
+ DatasourcesAction,
+ fetchDatasourceMetadata,
+ setDatasource,
+} from './datasources';
+
+const KEY = '7__table';
+
+const buildGetState =
+ (datasources: Record<string, any> = {}) =>
Review Comment:
Fixed in 3c99fa2. Replaced the `any` casts across this file — the state helper now uses `DatasourcesState`, the cached fixture is typed `Datasource`, and the `SupersetClient.get` mocks use the client's resolved response type (`Awaited<ReturnType<typeof SupersetClient.get>>`) via `unknown` rather than `any`, in line with the repo's no-`any` rule.
--
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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #39894:
URL: https://github.com/apache/superset/pull/39894#discussion_r3456292348
##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx:
##########
@@ -185,6 +200,27 @@ const FilterValue: FC<FilterValueProps> = ({
const [isRefreshing, setIsRefreshing] = useState(false);
const dispatch = useDispatch();
+ // When a Date Range parent filter is active, the child filter needs
+ // granularity_sqla to apply the temporal WHERE clause. Read main_dttm_col
+ // from the Redux datasource cache as a fallback.
+ //
+ // The dashboard datasets API (/api/v1/dashboard/:id/datasets) only returns
+ // datasets used by chart slices, so native-filter-only datasets are never
+ // in state.datasources. Dispatch fetchDatasourceMetadata at mount time to
+ // populate the cache explicitly for those datasets.
+ const datasourceMainDttmCol = useSelector<RootState, string | undefined>(
+ state =>
+ datasetId != null
+ ? state.datasources?.[`${datasetId}__table`]?.main_dttm_col
+ : undefined,
+ );
+
+ useEffect(() => {
+ if (datasetId != null) {
+ dispatch(fetchDatasourceMetadata(`${datasetId}__table`));
Review Comment:
**Suggestion:** This dispatch triggers an async thunk that can reject, but the promise is not handled in the effect. If the metadata request fails, it can produce an unhandled promise rejection in the browser and silently skip retry/error handling for this component lifecycle. Handle the returned promise (or make the thunk non-throwing) so failures are explicitly managed. [possible bug]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ Native filter metadata failures surface only as console rejections.
- ⚠️ Date-range cascading may misbehave when metadata fetch fails.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. In
`superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx`,
locate the `useEffect` that dispatches metadata fetches at lines 218-222. When `datasetId
!= null`, it calls `dispatch(fetchDatasourceMetadata(\`${datasetId}__table\`));` and does
not use the returned value or attach any error handler.
2. In `superset-frontend/src/dashboard/actions/datasources.ts:57-82`, see that
`fetchDatasourceMetadata` returns the Promise from `SupersetClient.get` (lines 71-73) and
chains `.then`/`.catch`. On error, the `.catch` at lines 78-80 deletes the in-flight key
and rethrows the error, so the thunk ultimately returns a *rejected* Promise when the
network call fails.
3. When a `FilterValue` component mounts for a filter with a `datasetId`, the `useEffect`
runs and dispatches `fetchDatasourceMetadata`. If `SupersetClient.get` rejects (for
example, due to a network error or 5xx from `/superset/fetch_datasource_metadata`), the
thunk's Promise rejects and `dispatch` propagates that rejection to its caller.
4. Because the `useEffect` neither `await`s the result in a `try/catch` nor chains
`.catch` on `dispatch(fetchDatasourceMetadata(...))`, the rejection has no handler at the
call site. In browsers, this manifests as an unhandled Promise rejection (triggering the
`unhandledrejection` event/console warnings) while the component lifecycle provides no
retry or user-visible error handling for the failed metadata load.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=50536b0cd505405dbf08bb8f9f2cb5c8&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=50536b0cd505405dbf08bb8f9f2cb5c8&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx
**Line:** 220:220
**Comment:**
*Possible Bug: This dispatch triggers an async thunk that can reject, but the promise is not handled in the effect. If the metadata request fails, it can produce an unhandled promise rejection in the browser and silently skip retry/error handling for this component lifecycle. Handle the returned promise (or make the thunk non-throwing) so failures are explicitly managed.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39894&comment_hash=361bbd5c1eef41f9cb12b79fe1f5a525abfb3dc53e395a009e886d9401b7353f&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39894&comment_hash=361bbd5c1eef41f9cb12b79fe1f5a525abfb3dc53e395a009e886d9401b7353f&reaction=dislike'>👎</a>
--
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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "jtjenkins (via GitHub)" <gi...@apache.org>.
jtjenkins commented on PR #39894:
URL: https://github.com/apache/superset/pull/39894#issuecomment-4800480434
Resolved by merging latest `master` (022c54195e). This branch was ~1048 commits behind, and the fuzzy `fr` entries came from source strings reworded upstream — not from this PR. The diff here touches only `datasources.ts`, `FilterValue.tsx`, and their tests, with **zero** `t()` string changes and no `.po`/`.pot` edits, so the regression was a branch-staleness artifact. Merging master brings in the already-updated `fr.po`. Verified locally after the merge: jest 11/11, prettier, oxlint, and `tsc --noEmit` all green.
--
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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #39894:
URL: https://github.com/apache/superset/pull/39894#discussion_r3456282222
##########
superset-frontend/src/dashboard/actions/datasources.test.ts:
##########
@@ -0,0 +1,105 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { SupersetClient } from '@superset-ui/core';
+import { RootState } from 'src/dashboard/types';
+import {
+ DatasourcesAction,
+ fetchDatasourceMetadata,
+ setDatasource,
+} from './datasources';
+
+const KEY = '7__table';
+
+const buildGetState =
+ (datasources: Record<string, any> = {}) =>
Review Comment:
**Suggestion:** Replace `Record<string, any>` with the existing datasource state type (for example `DatasourcesState` or `Record<string, Datasource>`) so the test state is strongly typed. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
The rule forbids added or modified TypeScript code that uses `any`. This test helper declares `Record<string, any>`, so the violation is present in the current file and the suggestion correctly identifies it.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=f4ba1d097d13443684feff59ee782d5c&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=f4ba1d097d13443684feff59ee782d5c&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/dashboard/actions/datasources.test.ts
**Line:** 29:30
**Comment:**
*Custom Rule: Replace `Record<string, any>` with the existing datasource state type (for example `DatasourcesState` or `Record<string, Datasource>`) so the test state is strongly typed.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39894&comment_hash=a22acccfe8d3faf57c86958a499f51a6124009e643c0ac264ad8600cead9ad44&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39894&comment_hash=a22acccfe8d3faf57c86958a499f51a6124009e643c0ac264ad8600cead9ad44&reaction=dislike'>👎</a>
##########
superset-frontend/src/dashboard/actions/datasources.test.ts:
##########
@@ -0,0 +1,105 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { SupersetClient } from '@superset-ui/core';
+import { RootState } from 'src/dashboard/types';
+import {
+ DatasourcesAction,
+ fetchDatasourceMetadata,
+ setDatasource,
+} from './datasources';
+
+const KEY = '7__table';
+
+const buildGetState =
+ (datasources: Record<string, any> = {}) =>
+ () =>
+ ({ datasources }) as RootState;
+
+afterEach(() => {
+ jest.restoreAllMocks();
+});
+
+test('fetchDatasourceMetadata uses the cached datasource without a network call', () => {
+ const getSpy = jest.spyOn(SupersetClient, 'get');
+ const dispatch = jest.fn();
+ const cached = { uid: KEY, main_dttm_col: 'ds' } as any;
+
+ fetchDatasourceMetadata(KEY)(dispatch, buildGetState({ [KEY]: cached }));
+
+ expect(getSpy).not.toHaveBeenCalled();
+ expect(dispatch).toHaveBeenCalledWith(setDatasource(cached, KEY));
+});
+
+test('fetchDatasourceMetadata fetches and caches an uncached datasource', async () => {
+ const json = { uid: KEY, main_dttm_col: 'ds' };
+ const getSpy = jest
+ .spyOn(SupersetClient, 'get')
+ .mockResolvedValue({ json } as any);
Review Comment:
**Suggestion:** Replace the mocked response `as any` cast with the concrete Superset client response shape expected by `SupersetClient.get`. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
The mocked resolved value is cast to `any`, so this is a direct instance of the prohibited pattern in the modified TypeScript file.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=5209ccdaced342489c2d6866f9080d39&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=5209ccdaced342489c2d6866f9080d39&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/dashboard/actions/datasources.test.ts
**Line:** 51:53
**Comment:**
*Custom Rule: Replace the mocked response `as any` cast with the concrete Superset client response shape expected by `SupersetClient.get`.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39894&comment_hash=4762ce47856f1f7671888c4a7ae27f9aa6f046d6bf4c2399f77a7e12605d6574&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39894&comment_hash=4762ce47856f1f7671888c4a7ae27f9aa6f046d6bf4c2399f77a7e12605d6574&reaction=dislike'>👎</a>
##########
superset-frontend/src/dashboard/actions/datasources.test.ts:
##########
@@ -0,0 +1,105 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { SupersetClient } from '@superset-ui/core';
+import { RootState } from 'src/dashboard/types';
+import {
+ DatasourcesAction,
+ fetchDatasourceMetadata,
+ setDatasource,
+} from './datasources';
+
+const KEY = '7__table';
+
+const buildGetState =
+ (datasources: Record<string, any> = {}) =>
+ () =>
+ ({ datasources }) as RootState;
+
+afterEach(() => {
+ jest.restoreAllMocks();
+});
+
+test('fetchDatasourceMetadata uses the cached datasource without a network call', () => {
+ const getSpy = jest.spyOn(SupersetClient, 'get');
+ const dispatch = jest.fn();
+ const cached = { uid: KEY, main_dttm_col: 'ds' } as any;
+
+ fetchDatasourceMetadata(KEY)(dispatch, buildGetState({ [KEY]: cached }));
+
+ expect(getSpy).not.toHaveBeenCalled();
+ expect(dispatch).toHaveBeenCalledWith(setDatasource(cached, KEY));
+});
+
+test('fetchDatasourceMetadata fetches and caches an uncached datasource', async () => {
+ const json = { uid: KEY, main_dttm_col: 'ds' };
+ const getSpy = jest
+ .spyOn(SupersetClient, 'get')
+ .mockResolvedValue({ json } as any);
+ const dispatch = jest.fn();
+
+ await fetchDatasourceMetadata(KEY)(dispatch, buildGetState());
+
+ expect(getSpy).toHaveBeenCalledTimes(1);
+ expect(dispatch).toHaveBeenCalledWith(
+ expect.objectContaining({
+ type: DatasourcesAction.SetDatasource,
+ key: KEY,
+ datasource: json,
+ }),
+ );
+});
+
+test('fetchDatasourceMetadata deduplicates concurrent in-flight requests for the same key', async () => {
+ let resolveGet: (value: unknown) => void = () => {};
+ const getSpy = jest.spyOn(SupersetClient, 'get').mockReturnValue(
+ new Promise(resolve => {
+ resolveGet = resolve;
+ }) as any,
Review Comment:
**Suggestion:** Type the mocked in-flight promise return value to the expected client response promise type instead of casting the promise to `any`. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
The mocked promise returned to `mockReturnValue` is cast to `any`, which violates the rule against using `any` in changed TypeScript code.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=2fe76130252947b7baae99d9edf82153&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=2fe76130252947b7baae99d9edf82153&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/dashboard/actions/datasources.test.ts
**Line:** 70:73
**Comment:**
*Custom Rule: Type the mocked in-flight promise return value to the expected client response promise type instead of casting the promise to `any`.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39894&comment_hash=e0f37360596cc5adadc7ca4ce736dbb08ff09fef6f630c017b427ff5c78764dc&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39894&comment_hash=e0f37360596cc5adadc7ca4ce736dbb08ff09fef6f630c017b427ff5c78764dc&reaction=dislike'>👎</a>
##########
superset-frontend/src/dashboard/actions/datasources.test.ts:
##########
@@ -0,0 +1,105 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { SupersetClient } from '@superset-ui/core';
+import { RootState } from 'src/dashboard/types';
+import {
+ DatasourcesAction,
+ fetchDatasourceMetadata,
+ setDatasource,
+} from './datasources';
+
+const KEY = '7__table';
+
+const buildGetState =
+ (datasources: Record<string, any> = {}) =>
+ () =>
+ ({ datasources }) as RootState;
+
+afterEach(() => {
+ jest.restoreAllMocks();
+});
+
+test('fetchDatasourceMetadata uses the cached datasource without a network call', () => {
+ const getSpy = jest.spyOn(SupersetClient, 'get');
+ const dispatch = jest.fn();
+ const cached = { uid: KEY, main_dttm_col: 'ds' } as any;
Review Comment:
**Suggestion:** Remove the `as any` cast on the cached datasource object and type it as the dashboard datasource type used by the action creator. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
The file contains an explicit `as any` cast on the cached datasource fixture, which matches the custom rule against `any` in changed TypeScript code.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=77cc4edeb91b4a968a07b180f9e19656&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=77cc4edeb91b4a968a07b180f9e19656&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/dashboard/actions/datasources.test.ts
**Line:** 41:41
**Comment:**
*Custom Rule: Remove the `as any` cast on the cached datasource object and type it as the dashboard datasource type used by the action creator.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39894&comment_hash=b9c45db13df663437db1fdb3b3fb6639cc5b4808fb99efead70975c6caf68ef1&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39894&comment_hash=b9c45db13df663437db1fdb3b3fb6639cc5b4808fb99efead70975c6caf68ef1&reaction=dislike'>👎</a>
##########
superset-frontend/src/dashboard/actions/datasources.test.ts:
##########
@@ -0,0 +1,105 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { SupersetClient } from '@superset-ui/core';
+import { RootState } from 'src/dashboard/types';
+import {
+ DatasourcesAction,
+ fetchDatasourceMetadata,
+ setDatasource,
+} from './datasources';
+
+const KEY = '7__table';
+
+const buildGetState =
+ (datasources: Record<string, any> = {}) =>
+ () =>
+ ({ datasources }) as RootState;
+
+afterEach(() => {
+ jest.restoreAllMocks();
+});
+
+test('fetchDatasourceMetadata uses the cached datasource without a network call', () => {
+ const getSpy = jest.spyOn(SupersetClient, 'get');
+ const dispatch = jest.fn();
+ const cached = { uid: KEY, main_dttm_col: 'ds' } as any;
+
+ fetchDatasourceMetadata(KEY)(dispatch, buildGetState({ [KEY]: cached }));
+
+ expect(getSpy).not.toHaveBeenCalled();
+ expect(dispatch).toHaveBeenCalledWith(setDatasource(cached, KEY));
+});
+
+test('fetchDatasourceMetadata fetches and caches an uncached datasource', async () => {
+ const json = { uid: KEY, main_dttm_col: 'ds' };
+ const getSpy = jest
+ .spyOn(SupersetClient, 'get')
+ .mockResolvedValue({ json } as any);
+ const dispatch = jest.fn();
+
+ await fetchDatasourceMetadata(KEY)(dispatch, buildGetState());
+
+ expect(getSpy).toHaveBeenCalledTimes(1);
+ expect(dispatch).toHaveBeenCalledWith(
+ expect.objectContaining({
+ type: DatasourcesAction.SetDatasource,
+ key: KEY,
+ datasource: json,
+ }),
+ );
+});
+
+test('fetchDatasourceMetadata deduplicates concurrent in-flight requests for the same key', async () => {
+ let resolveGet: (value: unknown) => void = () => {};
+ const getSpy = jest.spyOn(SupersetClient, 'get').mockReturnValue(
+ new Promise(resolve => {
+ resolveGet = resolve;
+ }) as any,
+ );
+ const dispatch = jest.fn();
+ const getState = buildGetState();
+
+ // Two filters using the same dataset mount and dispatch before the first
+ // request resolves and populates the cache.
+ fetchDatasourceMetadata(KEY)(dispatch, getState);
+ fetchDatasourceMetadata(KEY)(dispatch, getState);
+
+ expect(getSpy).toHaveBeenCalledTimes(1);
+
+ resolveGet({ json: { uid: KEY, main_dttm_col: 'ds' } });
+ await Promise.resolve();
+});
+
+test('fetchDatasourceMetadata clears the in-flight key after a failed request so it can retry', async () => {
+ const getSpy = jest
+ .spyOn(SupersetClient, 'get')
+ .mockRejectedValueOnce(new Error('boom'))
+ .mockResolvedValueOnce({ json: { uid: KEY } } as any);
Review Comment:
**Suggestion:** Remove the `as any` cast from the retry mock and provide a properly typed resolved response payload. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
This retry-path mock uses `as any`, so it is also a real violation of the TypeScript `any` rule in the edited file.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=0c2e8d67e14c4ab4a8ebefd366327d42&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=0c2e8d67e14c4ab4a8ebefd366327d42&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/dashboard/actions/datasources.test.ts
**Line:** 90:93
**Comment:**
*Custom Rule: Remove the `as any` cast from the retry mock and provide a properly typed resolved response payload.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39894&comment_hash=ac4020a606e6dccb4a1f02126932bcfe5e6e4de928d30dc441f92e04153a91b6&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39894&comment_hash=ac4020a606e6dccb4a1f02126932bcfe5e6e4de928d30dc441f92e04153a91b6&reaction=dislike'>👎</a>
--
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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #39894:
URL: https://github.com/apache/superset/pull/39894#issuecomment-4774437272
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 010f05304f76b92e2fa12fc03f84d8fcdc3a4211 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a39d4213e198900081e1fb8 |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-39894--superset-docs-preview.netlify.app](https://deploy-preview-39894--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><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#DctBCoAgEEDRu8w6SStCu0HHGHUswcrMoojunrsPn_dCTNsSMwwAFeiEq5lLO3_XK2Z_EXM-ZEpsKusMmHx-2LEHZAYPg5aKshTD9oy2uB5bZbtGtCSUVJxzKUg4LeH7AQ) |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-39894--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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39894:
URL: https://github.com/apache/superset/pull/39894#issuecomment-4381752954
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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "jtjenkins (via GitHub)" <gi...@apache.org>.
jtjenkins commented on code in PR #39894:
URL: https://github.com/apache/superset/pull/39894#discussion_r3475585715
##########
superset-frontend/src/dashboard/actions/datasources.ts:
##########
@@ -61,8 +63,21 @@ export function fetchDatasourceMetadata(key: string) {
return dispatch(setDatasource(datasource, key));
}
+ if (inFlightDatasourceKeys.has(key)) {
+ return undefined;
Review Comment:
Fixed in 9130ab39cb. Replaced the `Set` guard with a per-key `Map<string, Promise>` of in-flight requests and return the same promise to every concurrent caller, so completion and rejection propagate consistently (the `Promise.all([addChart, fetchDatasourceMetadata])` in `addSliceToDashboard` now actually awaits the metadata and observes errors). Cleanup moved to `.finally`. Added tests asserting concurrent callers share one promise and that a rejection reaches all awaiters.
--
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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #39894:
URL: https://github.com/apache/superset/pull/39894#issuecomment-4800337817
<!-- translation-regression-bot -->
## ⚠️ Translation Regression Detected
A source change in this PR renamed or reworded strings, invalidating existing translations (they are now `#, fuzzy`) in `fr`. Please resolve the affected `.po` files before merging.
_Note: intentionally **deleting** a translatable string is not a regression and is not flagged here — only translations invalidated by a renamed/reworded source string are._
| Language | Fuzzy before | Fuzzy after | New |
|----------|-------------:|------------:|----:|
| `fr` | 1004 | 1014 | +10 |
### How to fix
**1. Install dependencies** (if not already set up):
```bash
pip install -r superset/translations/requirements.txt
sudo apt-get install gettext # or: brew install gettext
```
**2. Re-extract strings and sync `.po` files:**
```bash
./scripts/translations/babel_update.sh
```
This 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`):
```bash
grep -n '#, fuzzy' superset/translations/<lang>/LC_MESSAGES/messages.po
```
For 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.**
--
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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "jtjenkins (via GitHub)" <gi...@apache.org>.
jtjenkins commented on PR #39894:
URL: https://github.com/apache/superset/pull/39894#issuecomment-4774427479
Thanks for the review @rusackas! Addressed in 010f053:
- **Prettier** — re-ran prettier on `FilterValue.tsx`; format check is green now.
- **`as Record<string, any>` cast** — dropped it. `state.datasources` is already typed as `DatasourcesState`, so `main_dttm_col` resolves to `string | undefined` with no `any`.
- **Test coverage** — pinned down both pieces of logic:
- Extracted the granularity resolution into an exported pure `resolveGranularitySqla()` helper and covered the cascade cases (own value wins, `main_dttm_col` fallback when a `time_range` parent cascades, no-dependency, and no-dttm) in `FilterValue.timeGrain.test.ts`.
- Added `datasources.test.ts` for the in-flight dedup `Set`: cache-hit short-circuit, single fetch, concurrent de-duplication of the same key, and key cleanup after a failed request so it can retry.
The bot's dedup suggestion was already implemented in b582c8a (the in-flight `Set`), so no functional change needed there — just the test pinning it down.
--
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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39894:
URL: https://github.com/apache/superset/pull/39894#issuecomment-4775349347
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers a full AI review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39894:
URL: https://github.com/apache/superset/pull/39894#issuecomment-4381797757
<!-- Bito Reply -->
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**
```
const pendingFetches = new Map();
export const fetchDatasourceMetadata = (key) => (dispatch, getState) => {
if (getState().datasources[key]) return;
if (pendingFetches.has(key)) return;
const promise = SupersetClient.get({ endpoint: `/superset/fetch_datasource_metadata?datasourceKey=${key}` })
.then(data => {
dispatch(setDatasource(key, data));
pendingFetches.delete(key);
})
.catch(() => pendingFetches.delete(key));
pendingFetches.set(key, promise);
};
```
--
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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #39894:
URL: https://github.com/apache/superset/pull/39894#discussion_r3190556597
##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx:
##########
@@ -185,6 +186,28 @@ const FilterValue: FC<FilterValueProps> = ({
const [isRefreshing, setIsRefreshing] = useState(false);
const dispatch = useDispatch();
+ // When a Date Range parent filter is active, the child filter needs
+ // granularity_sqla to apply the temporal WHERE clause. Read main_dttm_col
+ // from the Redux datasource cache as a fallback.
+ //
+ // The dashboard datasets API (/api/v1/dashboard/:id/datasets) only returns
+ // datasets used by chart slices, so native-filter-only datasets are never
+ // in state.datasources. Dispatch fetchDatasourceMetadata at mount time to
+ // populate the cache explicitly for those datasets.
+ const datasourceMainDttmCol = useSelector<RootState, string | null | undefined>(
+ state =>
+ datasetId != null
+ ? (state.datasources as Record<string, any>)?.[`${datasetId}__table`]
+ ?.main_dttm_col
+ : undefined,
+ );
+
+ useEffect(() => {
+ if (datasetId != null) {
+ dispatch(fetchDatasourceMetadata(`${datasetId}__table`));
+ }
+ }, [datasetId, dispatch]);
Review Comment:
**Suggestion:** Dispatching metadata fetch on mount without in-flight deduplication can trigger concurrent duplicate requests when multiple filters use the same dataset and mount together. Each instance sees an empty cache and fires its own request, causing avoidable API load and possible last-write-wins state churn; guard this with request deduplication (or a shared loading flag) before dispatching. [race condition]
<details>
<summary><b>Severity Level:</b> Minor 🧹</summary>
```mdx
- ⚠️ Extra GETs to /superset/fetch_datasource_metadata per shared dataset.
- ⚠️ Slightly slower dashboard load for filter-only datasets.
- ⚠️ Unnecessary backend load when many filters share one dataset.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Open a dashboard that uses multiple native filters all pointing to the same dataset ID
(each filter's config provides the same `datasetId` in its `targets`), so multiple
`FilterControl` instances render. These controls render `FilterValue` from
`src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControl.tsx:20-34`,
which in turn mounts multiple `FilterValue` components.
2. When each `FilterValue` mounts, its `useEffect` at `FilterValue.tsx:205-209` runs, and
for each instance with a non-null `datasetId` it dispatches
`fetchDatasourceMetadata(\`${datasetId}__table\`)` via `dispatch`.
3. The thunk `fetchDatasourceMetadata` is defined in
`src/dashboard/actions/datasources.ts:16-28`. It checks `getState().datasources[key]`, and
if the entry is missing it calls `SupersetClient.get({ endpoint:
\`/superset/fetch_datasource_metadata?datasourceKey=${key}\` })` without tracking
in-flight requests.
4. Because each `FilterValue` instance calls `dispatch(fetchDatasourceMetadata(...))` in a
separate effect but before any of the network calls resolve and populate
`state.datasources[key]`, all of them see an empty cache and issue parallel GET requests
to `/superset/fetch_datasource_metadata?datasourceKey=${datasetId}__table`. This results
in duplicate metadata fetches for the same dataset but does not cause functional race
conditions, since each response ultimately dispatches `setDatasource` with the same
payload.
```
</details>
[Fix in Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0A%0A%2A%2APath%3A%2A%2A%20superset-frontend%2Fsrc%2Fdashboard%2Fcomponents%2FnativeFilters%2FFilterBar%2FFilterControls%2FFilterValue.tsx%0A%2A%2ALine%3A%2A%2A%20205%3A209%0A%2A%2AComment%3A%2A%2A%0A%09%2ARace%20Condition%3A%20Dispatching%20metadata%20fetch%20on%20mount%20without%20in-flight%20deduplication%20can%20trigger%20concurrent%20duplicate%20requests%20when%20multiple%20filters%20use%20the%20same%20dataset%20and%20mount%20together.%20Each%20instance%20sees%20an%20empty%20cache%20and%20fires%20its%20own%20request%2C%20causing%20avoidable%20API%20load%20and%20possible%20last-write-wins%20state%20churn%3B%20guard%20this%20with%20request%20deduplication%20%28or%20a%20shared%20loading%20flag%29%20before%20dispatching.%0A%0AValidate%20the%20correctness%20of%20the%20flagged%20issue.%20If%20correct%2C%20How%20can%20I%20resolve%20this%3F%20If%20you%20pr
opose%20a%20fix%2C%20implement%20it%20and%20please%20make%20it%20concise.%0AOnce%20fix%20is%20implemented%2C%20also%20check%20other%20comments%20on%20the%20same%20PR%2C%20and%20ask%20user%20if%20the%20user%20wants%20to%20fix%20the%20rest%20of%20the%20comments%20as%20well.%20if%20said%20yes%2C%20then%20fetch%20all%20the%20comments%20validate%20the%20correctness%20and%20implement%20a%20minimal%20fix%0A) | [Fix in VSCode Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0A%0A%2A%2APath%3A%2A%2A%20superset-frontend%2Fsrc%2Fdashboard%2Fcomponents%2FnativeFilters%2FFilterBar%2FFilterControls%2FFilterValue.tsx%0A%2A%2ALine%3A%2A%2A%20205%3A209%0A%2A%2AComment%3A%2A%2A%0A%09%2ARace%20Condition%3A%20Dispatching%20metadata%20fetch%20on%20mount%20without%20in-flight%20deduplication%20can%20trigger%20concurrent%20duplicate%20requests%20when%20multiple%20filters%20use%20the%20same%20dataset%20and%20mount%20together.%2
0Each%20instance%20sees%20an%20empty%20cache%20and%20fires%20its%20own%20request%2C%20causing%20avoidable%20API%20load%20and%20possible%20last-write-wins%20state%20churn%3B%20guard%20this%20with%20request%20deduplication%20%28or%20a%20shared%20loading%20flag%29%20before%20dispatching.%0A%0AValidate%20the%20correctness%20of%20the%20flagged%20issue.%20If%20correct%2C%20How%20can%20I%20resolve%20this%3F%20If%20you%20propose%20a%20fix%2C%20implement%20it%20and%20please%20make%20it%20concise.%0AOnce%20fix%20is%20implemented%2C%20also%20check%20other%20comments%20on%20the%20same%20PR%2C%20and%20ask%20user%20if%20the%20user%20wants%20to%20fix%20the%20rest%20of%20the%20comments%20as%20well.%20if%20said%20yes%2C%20then%20fetch%20all%20the%20comments%20validate%20the%20correctness%20and%20implement%20a%20minimal%20fix%0A)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx
**Line:** 205:209
**Comment:**
*Race Condition: Dispatching metadata fetch on mount without in-flight deduplication can trigger concurrent duplicate requests when multiple filters use the same dataset and mount together. Each instance sees an empty cache and fires its own request, causing avoidable API load and possible last-write-wins state churn; guard this with request deduplication (or a shared loading flag) before dispatching.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39894&comment_hash=3b8f518c4b11c88d04c2b181f8e8201a176dc6d44790837937cabfe8d8bd31ab&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39894&comment_hash=3b8f518c4b11c88d04c2b181f8e8201a176dc6d44790837937cabfe8d8bd31ab&reaction=dislike'>👎</a>
--
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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #39894:
URL: https://github.com/apache/superset/pull/39894#discussion_r3475256909
##########
superset-frontend/src/dashboard/actions/datasources.ts:
##########
@@ -61,8 +63,21 @@ export function fetchDatasourceMetadata(key: string) {
return dispatch(setDatasource(datasource, key));
}
+ if (inFlightDatasourceKeys.has(key)) {
+ return undefined;
Review Comment:
**Suggestion:** Returning `undefined` for duplicate in-flight requests breaks the thunk contract for callers that await this action. Any concurrent caller (for example code using `Promise.all` with `dispatch(fetchDatasourceMetadata(...))`) will proceed immediately instead of waiting for metadata, and it also cannot observe a rejection if the original request fails. Keep a per-key in-flight promise map and return the same promise to all callers so completion/error is propagated consistently. [race condition]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ addSliceToDashboard may not await datasource metadata.
- ⚠️ Callers cannot observe failures from original metadata request.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Observe the thunk implementation in
`superset-frontend/src/dashboard/actions/datasources.ts` lines 57–70:
`fetchDatasourceMetadata(key)` returns either a cached datasource, a
`SupersetClient.get(...).then(...)` promise, or `undefined` when `inFlightDatasourceKeys`
contains `key` (guard at lines 66–67).
2. Confirm that callers treat this thunk as promise-returning:
`superset-frontend/src/dashboard/actions/datasources.test.ts` lines 65–69 `await
fetchDatasourceMetadata(KEY)(dispatch, buildGetState());` and lines 27–29 `await
expect(fetchDatasourceMetadata(KEY)(dispatch, getState)).rejects.toThrow('boom');` both
rely on the inner function returning a promise that resolves or rejects.
3. Inspect `superset-frontend/src/dashboard/actions/dashboardState.ts` lines 918–929 where
`addSliceToDashboard` is defined to return `Promise<void> | AnyAction`, and lines 943–947
where it does `return Promise.all([dispatch(addChart(newChart, id)),
dispatch(fetchDatasourceMetadata(form_data.datasource as string))]).then(() => {
dispatch(addSlice(selectedSlice as Slice)); });`, showing a real caller that expects
`dispatch(fetchDatasourceMetadata(...))` to contribute a promise to `Promise.all`.
4. Trigger a duplicate in-flight request for the same datasource key (e.g., dispatch
`fetchDatasourceMetadata(KEY)` from any component or thunk, then dispatch
`addSliceToDashboard` for a slice whose `form_data.datasource` is the same KEY before the
first request resolves). The second call hits the guard at `datasources.ts:66–67` and
returns `undefined`; as a result, `Promise.all([... , undefined])` in
`dashboardState.ts:943–947` resolves without waiting for metadata, and any caller awaiting
`addSliceToDashboard` neither waits for completion of the original metadata fetch nor can
observe its rejection if it fails.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=3956d671e8d141d39b2db6ec125eae83&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=3956d671e8d141d39b2db6ec125eae83&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/dashboard/actions/datasources.ts
**Line:** 66:67
**Comment:**
*Race Condition: Returning `undefined` for duplicate in-flight requests breaks the thunk contract for callers that await this action. Any concurrent caller (for example code using `Promise.all` with `dispatch(fetchDatasourceMetadata(...))`) will proceed immediately instead of waiting for metadata, and it also cannot observe a rejection if the original request fails. Keep a per-key in-flight promise map and return the same promise to all callers so completion/error is propagated consistently.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39894&comment_hash=cbb5a98b60e50c303297e10fe7a569620c678069b11c419ffd76b929e6ac0a1f&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39894&comment_hash=cbb5a98b60e50c303297e10fe7a569620c678069b11c419ffd76b929e6ac0a1f&reaction=dislike'>👎</a>
--
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] fix(native-filters): populate granularity_sqla from datasource main_dttm_col for time-range parent cascade [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #39894:
URL: https://github.com/apache/superset/pull/39894#issuecomment-4773879444
Prettier is failing on `FilterValue.tsx` — a quick `pre-commit run prettier` should sort that out and get CI green.
The `state.datasources as Record<string, any>` cast is the bit I'd want to lose before we merge — we're trying to get away from `any`, and the new `main_dttm_col` fallback plus the in-flight dedup `Set` are exactly the kind of logic I'd want a test pinning down. Can you add coverage for the cascade case?
(The playwright/cypress reds look like the usual flaky export/delete suites, not your change — don't sweat those.)
--
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