You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "vgvoleg (via GitHub)" <gi...@apache.org> on 2026/04/17 11:18:06 UTC
[PR] feat: support creating datasets for schema-less databases [superset]
vgvoleg opened a new pull request, #39433:
URL: https://github.com/apache/superset/pull/39433
### SUMMARY
YDB and other databases that don't use schemas were broken in the dataset creation flow: the schema selector blocked the UI and table metadata could not be loaded without a schema.
- Add `supports_schemas` class variable to `BaseEngineSpec` (default True) and expose it via `get_public_information()` so the frontend can detect schema-less engines
- Set `supports_schemas = False` on `YDBEngineSpec`
- Hide schema selector in `DatabaseSelector` when `supports_schemas=false`
- Enable table selector without a schema in `TableSelector`
- Load table column metadata without schema in `DatasetPanel`
- Fetch existing dataset hints without schema filter in `useDatasetsList`
- Override schema to `None` in `TablesDatabaseCommand` for schema-less DBs
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<img width="302" height="232" alt="image" src="https://github.com/user-attachments/assets/943bf003-de64-4252-abb8-0e00f1d6d46d" />
### TESTING INSTRUCTIONS
Connect to YDB and try to create dataset.
### ADDITIONAL INFORMATION
Fixes: #31022
- [ ] Has associated issue:
- [ ] Required feature flags:
- [x] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: support creating datasets for schema-less databases [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39433:
URL: https://github.com/apache/superset/pull/39433#issuecomment-4268732658
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] feat: support creating datasets for schema-less databases [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 #39433:
URL: https://github.com/apache/superset/pull/39433#discussion_r3099871287
##########
superset-frontend/src/components/TableSelector/index.tsx:
##########
@@ -302,7 +302,9 @@ const TableSelector: FunctionComponent<TableSelectorProps> = ({
);
function renderTableSelect() {
- const disabled = (currentSchema && !formMode && readOnly) || !currentSchema;
+ const disabled =
+ (currentSchema && !formMode && readOnly) ||
+ (database?.supports_schemas !== false && !currentSchema);
Review Comment:
**Suggestion:** The table select is not reliably disabled in read-only mode for schema-less databases, so users can still interact with and change table selection when editing should be blocked. Make read-only an unconditional disable condition. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ Physical dataset editor shows editable table for schema-less DBs.
- ⚠️ Users can change table selection visually in read-only views.
```
</details>
```suggestion
readOnly || (database?.supports_schemas !== false && !currentSchema);
```
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Configure a schema-less database (e.g. YDB) and create a physical dataset that uses it,
then open the dataset in the datasource editor view (non-edit mode). This uses
`DatasourceEditor` at
`superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx:2066`,
which renders `<TableSelector ... readOnly={!this.state.isEditMode} />`, so `readOnly` is
`true` when `isEditMode` is `false`.
2. In this view, the `TableSelector` component at
`superset-frontend/src/components/TableSelector/index.tsx:155-173` receives `database`
with `supports_schemas === false` and a `schema` prop that remains `undefined` for the
schema-less engine; `currentSchema` state is initialized from this `schema` at lines
176-180.
3. When `renderTableSelect()` runs at `index.tsx:304-308`, it computes `const disabled =
(currentSchema && !formMode && readOnly) || (database?.supports_schemas !== false &&
!currentSchema);`. For the schema-less database in read-only mode, `readOnly` is `true`,
`database?.supports_schemas === false`, and `currentSchema` is `undefined`, so both
disjuncts evaluate to `false` and `disabled` becomes `false`.
4. Because `disabled` is `false`, the `<Select>` control at `index.tsx:311-329` remains
fully interactive even in read-only mode. Users can open the dropdown and change the
visual table selection, despite the rest of the editor being locked (e.g. `onDbChange`,
`onCatalogChange`, `onSchemaChange`, and `onTableSelectChange` are disabled when
`readOnly` is true in `DatasourceEditor`). This results in a misleading,
not-truly-read-only table selector specifically for schema-less databases.
```
</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%2Fcomponents%2FTableSelector%2Findex.tsx%0A%2A%2ALine%3A%2A%2A%20306%3A307%0A%2A%2AComment%3A%2A%2A%0A%09%2ALogic%20Error%3A%20The%20table%20select%20is%20not%20reliably%20disabled%20in%20read-only%20mode%20for%20schema-less%20databases%2C%20so%20users%20can%20still%20interact%20with%20and%20change%20table%20selection%20when%20editing%20should%20be%20blocked.%20Make%20read-only%20an%20unconditional%20disable%20condition.%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.%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%20super
set-frontend%2Fsrc%2Fcomponents%2FTableSelector%2Findex.tsx%0A%2A%2ALine%3A%2A%2A%20306%3A307%0A%2A%2AComment%3A%2A%2A%0A%09%2ALogic%20Error%3A%20The%20table%20select%20is%20not%20reliably%20disabled%20in%20read-only%20mode%20for%20schema-less%20databases%2C%20so%20users%20can%20still%20interact%20with%20and%20change%20table%20selection%20when%20editing%20should%20be%20blocked.%20Make%20read-only%20an%20unconditional%20disable%20condition.%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.%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/components/TableSelector/index.tsx
**Line:** 306:307
**Comment:**
*Logic Error: The table select is not reliably disabled in read-only mode for schema-less databases, so users can still interact with and change table selection when editing should be blocked. Make read-only an unconditional disable condition.
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.
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39433&comment_hash=bbb9cd2d07f7beccb78038700c06135e503205363729f3c41089867ed2e0045e&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39433&comment_hash=bbb9cd2d07f7beccb78038700c06135e503205363729f3c41089867ed2e0045e&reaction=dislike'>👎</a>
##########
superset-frontend/src/features/datasets/hooks/useDatasetLists.ts:
##########
@@ -37,7 +37,8 @@ const useDatasetsList = (
schema: string | null | undefined,
) => {
const [datasets, setDatasets] = useState<DatasetObject[]>([]);
- const encodedSchema = schema ? encodeURIComponent(schema) : undefined;
+ const supportsSchemas = db?.supports_schemas !== false;
+ const encodedSchema = schema ? encodeURIComponent(schema) : null;
Review Comment:
**Suggestion:** The schema value is being URL-encoded before it is passed to `rison.encode_uri`, which causes double-encoding in the final request (`%20` becomes `%2520`). This sends the wrong schema filter value to the backend and can return no datasets for schemas with spaces or special characters. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ Existing-dataset hints break for schemas with spaces/special chars.
- ⚠️ DatasetPanel may not warn about already-existing datasets.
- ⚠️ Users may inadvertently create duplicate datasets for a table.
- ⚠️ Any consumer of datasetNames gets incomplete/incorrect results.
```
</details>
```suggestion
const encodedSchema = schema ?? null;
```
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. In the hook implementation at
`superset-frontend/src/features/datasets/hooks/useDatasetLists.ts:31-52`, note that
`encodedSchema` is computed with `encodeURIComponent(schema)` (line 41) and then used in
the `filters` array (lines 79-85), which is passed to `rison.encode_uri({ filters, page
})` (line 51). The resulting string is used as the `q` query parameter in the GET endpoint
`/api/v1/dataset/?q=${queryParams}` (line 55).
2. Use the existing test harness in
`superset-frontend/src/features/datasets/hooks/useDatasetLists.test.ts`. Following the
pattern of the first test (`useDatasetsList fetches first page of datasets successfully`,
lines 50-66), render the hook with a schema containing a space, for example:
`renderHook(() => useDatasetsList(mockDb, 'my schema'));`
where `mockDb` is the same object defined at lines 31-35 of the test file.
3. Spy on `SupersetClient.get` as in the tests (lines 51-56) and inspect the `endpoint`
argument that `useDatasetsList` passes to `SupersetClient.get`. Because `schema` was
pre-encoded by `encodeURIComponent` at line 41 and then the entire Rison string is
URI-encoded again by `rison.encode_uri` at line 51, the `q` parameter in the endpoint will
contain the schema value as `my%2520schema` instead of `my%20schema`.
4. In a real backend call, this double-encoded schema (`my%2520schema`) would be decoded
once by the server-side URL parsing, yielding `my%20schema` rather than the actual schema
name `my schema`. Consequently, the `/api/v1/dataset` filter `{ col: 'schema', opr: 'eq',
value: 'my%20schema' }` will not match datasets whose schema is `my schema`, causing
`useDatasetsList` to receive an empty or incorrect dataset list and propagating wrong
`datasets` / `datasetNames` to any consumers (e.g., components that rely on them to show
"existing dataset" hints).
```
</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%2Ffeatures%2Fdatasets%2Fhooks%2FuseDatasetLists.ts%0A%2A%2ALine%3A%2A%2A%2041%3A41%0A%2A%2AComment%3A%2A%2A%0A%09%2ALogic%20Error%3A%20The%20schema%20value%20is%20being%20URL-encoded%20before%20it%20is%20passed%20to%20%60rison.encode_uri%60%2C%20which%20causes%20double-encoding%20in%20the%20final%20request%20%28%60%2520%60%20becomes%20%60%252520%60%29.%20This%20sends%20the%20wrong%20schema%20filter%20value%20to%20the%20backend%20and%20can%20return%20no%20datasets%20for%20schemas%20with%20spaces%20or%20special%20characters.%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.%0A) | [Fix in VSCode Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-cla
ude&prompt=This%20is%20a%20comment%20left%20during%20a%20code%20review.%0A%0A%2A%2APath%3A%2A%2A%20superset-frontend%2Fsrc%2Ffeatures%2Fdatasets%2Fhooks%2FuseDatasetLists.ts%0A%2A%2ALine%3A%2A%2A%2041%3A41%0A%2A%2AComment%3A%2A%2A%0A%09%2ALogic%20Error%3A%20The%20schema%20value%20is%20being%20URL-encoded%20before%20it%20is%20passed%20to%20%60rison.encode_uri%60%2C%20which%20causes%20double-encoding%20in%20the%20final%20request%20%28%60%2520%60%20becomes%20%60%252520%60%29.%20This%20sends%20the%20wrong%20schema%20filter%20value%20to%20the%20backend%20and%20can%20return%20no%20datasets%20for%20schemas%20with%20spaces%20or%20special%20characters.%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.%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/features/datasets/hooks/useDatasetLists.ts
**Line:** 41:41
**Comment:**
*Logic Error: The schema value is being URL-encoded before it is passed to `rison.encode_uri`, which causes double-encoding in the final request (`%20` becomes `%2520`). This sends the wrong schema filter value to the backend and can return no datasets for schemas with spaces or special characters.
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.
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39433&comment_hash=2d5d50bf66a0a36daebf55f28aa2cbd13ae5c0a008f7b3ed27713afd0a364748&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39433&comment_hash=2d5d50bf66a0a36daebf55f28aa2cbd13ae5c0a008f7b3ed27713afd0a364748&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] feat: support creating datasets for schema-less databases [superset]
Posted by "vgvoleg (via GitHub)" <gi...@apache.org>.
vgvoleg commented on PR #39433:
URL: https://github.com/apache/superset/pull/39433#issuecomment-4286647261
@rusackas hi!
as was discussed in https://github.com/apache/superset/issues/31022 I'm happy to implement my idea about how this should look. Let me know if there's something missing
--
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] feat: support creating datasets for schema-less databases [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #39433:
URL: https://github.com/apache/superset/pull/39433#discussion_r3101020285
##########
superset/commands/database/tables.py:
##########
@@ -44,7 +44,7 @@ def __init__(
self,
db_id: int,
catalog_name: str | None,
- schema_name: str,
+ schema_name: str | None,
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Type Hint Inconsistency</b></div>
<div id="fix">
The schema_name parameter type has been correctly updated to str | None to allow None values for databases without schema support. However, the Database model methods get_all_table_names_in_schema, get_all_view_names_in_schema, and get_all_materialized_view_names_in_schema still declare schema: str, but they pass this parameter to engine spec methods that accept str | None. This type inconsistency will cause mypy errors when _schema_name is None. Update the model method signatures to schema: str | None for type safety.
</div>
</div>
<small><i>Code Review Run #bf22d2</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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] feat: support creating datasets for schema-less databases [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #39433:
URL: https://github.com/apache/superset/pull/39433#issuecomment-4267572210
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/39433?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `50.00000%` with `2 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 55.39%. Comparing base ([`0b419a0`](https://app.codecov.io/gh/apache/superset/commit/0b419a07f54f3de1b0bb89a41c9b5b047f928f79?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`93b16df`](https://app.codecov.io/gh/apache/superset/commit/93b16dfca2d78bd2bdea8d5c2562c7a30f7421a5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 11 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/39433?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [superset/commands/database/tables.py](https://app.codecov.io/gh/apache/superset/pull/39433?src=pr&el=tree&filepath=superset%2Fcommands%2Fdatabase%2Ftables.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY29tbWFuZHMvZGF0YWJhc2UvdGFibGVzLnB5) | 0.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/39433?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
:x: Your project check has failed because the head coverage (99.79%) is below the target coverage (100.00%). You can increase the head coverage or adjust the [target](https://docs.codecov.com/docs/commit-status#target) coverage.
> :exclamation: There is a different number of reports uploaded between BASE (0b419a0) and HEAD (93b16df). Click for more details.
>
> <details><summary>HEAD has 108 uploads less than BASE</summary>
>
>| Flag | BASE (0b419a0) | HEAD (93b16df) |
>|------|------|------|
>|python|100|1|
>|presto|10|1|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #39433 +/- ##
==========================================
- Coverage 64.54% 55.39% -9.15%
==========================================
Files 2557 2557
Lines 132985 133082 +97
Branches 30890 30901 +11
==========================================
- Hits 85829 73717 -12112
- Misses 45666 58713 +13047
+ Partials 1490 652 -838
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/39433/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [hive](https://app.codecov.io/gh/apache/superset/pull/39433/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [mysql](https://app.codecov.io/gh/apache/superset/pull/39433/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [postgres](https://app.codecov.io/gh/apache/superset/pull/39433/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [presto](https://app.codecov.io/gh/apache/superset/pull/39433/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.66% <50.00%> (-0.06%)` | :arrow_down: |
| [python](https://app.codecov.io/gh/apache/superset/pull/39433/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.66% <50.00%> (-20.60%)` | :arrow_down: |
| [sqlite](https://app.codecov.io/gh/apache/superset/pull/39433/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit](https://app.codecov.io/gh/apache/superset/pull/39433/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/39433?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: support creating datasets for schema-less databases [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39433:
URL: https://github.com/apache/superset/pull/39433#issuecomment-4278967049
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] feat: support creating datasets for schema-less databases [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39433:
URL: https://github.com/apache/superset/pull/39433#issuecomment-4318568343
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] feat: support creating datasets for schema-less databases [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39433:
URL: https://github.com/apache/superset/pull/39433#issuecomment-4276677605
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] feat: support creating datasets for schema-less databases [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 #39433:
URL: https://github.com/apache/superset/pull/39433#discussion_r3099875872
##########
superset-frontend/src/components/DatabaseSelector/index.tsx:
##########
@@ -254,6 +255,8 @@ export function DatabaseSelector({
database_name: row.database_name,
backend: row.backend,
allow_multi_catalog: row.allow_multi_catalog,
+ supports_schemas:
+ (row as any).engine_information?.supports_schemas !== false,
Review Comment:
**🟠 Architect Review — HIGH**
The schema-less behavior assumes the selected `db` always has a top-level `supports_schemas` flag, but when `db` comes from sources like LocalStorage (which only provide `engine_information.supports_schemas`), `currentDb.supports_schemas` is `undefined`, so `showSchemaSelector` evaluates to `true` and schema-less engines (e.g. YDB) revert to schema-required UX in flows like "Create dataset" / "Query data in SQL Lab".
**Suggestion:** When initializing `currentDb` from the `db` prop, derive `supports_schemas` from either `db.supports_schemas` or `db.engine_information.supports_schemas` and store that normalized value; use this normalized flag (and/or fall back similarly in `TableSelector`) as the single source of truth for schema-less behavior.
[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%2Fcomponents%2FDatabaseSelector%2Findex.tsx%0A%2A%2ALine%3A%2A%2A%20188%3A259%0A%2A%2AComment%3A%2A%2A%0A%09%2AHIGH%3A%20The%20schema-less%20behavior%20assumes%20the%20selected%20%60db%60%20always%20has%20a%20top-level%20%60supports_schemas%60%20flag%2C%20but%20when%20%60db%60%20comes%20from%20sources%20like%20LocalStorage%20%28which%20only%20provide%20%60engine_information.supports_schemas%60%29%2C%20%60currentDb.supports_schemas%60%20is%20%60undefined%60%2C%20so%20%60showSchemaSelector%60%20evaluates%20to%20%60true%60%20and%20schema-less%20engines%20%28e.g.%20YDB%29%20revert%20to%20schema-required%20UX%20in%20flows%20like%20%22Create%20dataset%22%20%2F%20%22Query%20data%20in%20SQL%20Lab%22.%0A%0AValidate%20the%20correctness%20of%20the%20flagged%20issue.%20If%20correct%2C%20How%20can%20I%20resolve%20th
is%3F%20If%20you%20propose%20a%20fix%2C%20implement%20it%20and%20please%20make%20it%20concise.%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%2Fcomponents%2FDatabaseSelector%2Findex.tsx%0A%2A%2ALine%3A%2A%2A%20188%3A259%0A%2A%2AComment%3A%2A%2A%0A%09%2AHIGH%3A%20The%20schema-less%20behavior%20assumes%20the%20selected%20%60db%60%20always%20has%20a%20top-level%20%60supports_schemas%60%20flag%2C%20but%20when%20%60db%60%20comes%20from%20sources%20like%20LocalStorage%20%28which%20only%20provide%20%60engine_information.supports_schemas%60%29%2C%20%60currentDb.supports_schemas%60%20is%20%60undefined%60%2C%20so%20%60showSchemaSelector%60%20evaluates%20to%20%60true%60%20and%20schema-less%20engines%20%28e.g.%20YDB%29%20revert%20to%20schema-required%20UX%20in%20flows%20like%20%22Create%20dataset%22%20%2F%20%22Query%20data%20in%20SQL%20Lab%22.
%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.%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/components/DatabaseSelector/index.tsx
**Line:** 188:259
**Comment:**
*HIGH: The schema-less behavior assumes the selected `db` always has a top-level `supports_schemas` flag, but when `db` comes from sources like LocalStorage (which only provide `engine_information.supports_schemas`), `currentDb.supports_schemas` is `undefined`, so `showSchemaSelector` evaluates to `true` and schema-less engines (e.g. YDB) revert to schema-required UX in flows like "Create dataset" / "Query data in SQL Lab".
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.
```
</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] feat: support creating datasets for schema-less databases [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #39433:
URL: https://github.com/apache/superset/pull/39433#issuecomment-4267584641
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 93b16dfca2d78bd2bdea8d5c2562c7a30f7421a5 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/69e216ed06556a0008994d65 |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-39433--superset-docs-preview.netlify.app](https://deploy-preview-39433--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> |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-39433--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] feat: support creating datasets for schema-less databases [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #39433:
URL: https://github.com/apache/superset/pull/39433#discussion_r3099901761
##########
superset/commands/database/tables.py:
##########
@@ -55,6 +55,8 @@ def __init__(
def run(self) -> dict[str, Any]:
self.validate()
self._catalog_name = self._catalog_name or self._model.get_default_catalog()
+ if not self._model.db_engine_spec.supports_schemas:
+ self._schema_name = None # type: ignore[assignment]
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Type Hint Inconsistency</b></div>
<div id="fix">
The type ignore suppresses a mypy error for assigning None to _schema_name, which is typed as str. However, for databases without schema support, _schema_name must be None, and downstream methods like get_all_table_names_in_schema are called with None (as verified in tests). To achieve mypy compliance per dev-standard.mdc, update type hints to str | None for schema-related fields and parameters across the codebase.
</div>
</div>
<small><i>Code Review Run #f15404</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
##########
superset-frontend/src/hooks/apiResources/tables.ts:
##########
@@ -177,9 +186,9 @@ export function useTables(options: Params) {
[schemaOptions],
);
- const enabled = Boolean(
- dbId && schema && !isFetching && schemaOptionsMap.has(schema),
- );
+ const enabled = supportsSchemas
+ ? Boolean(dbId && schema && !isFetching && schemaOptionsMap.has(schema))
+ : Boolean(dbId && !isFetching);
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Performance regression</b></div>
<div id="fix">
The `enabled` condition still checks `!isFetching` even when `supportsSchemas` is false, causing table queries to wait for schema fetching unnecessarily. This introduces a performance regression for databases without schemas. Change the false case to `Boolean(dbId)` to allow immediate querying.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
const enabled = supportsSchemas
? Boolean(dbId && schema && !isFetching && schemaOptionsMap.has(schema))
: Boolean(dbId);
````
</div>
</details>
</div>
<small><i>Code Review Run #f15404</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
##########
superset-frontend/src/components/DatabaseSelector/index.tsx:
##########
@@ -254,6 +255,8 @@ export function DatabaseSelector({
database_name: row.database_name,
backend: row.backend,
allow_multi_catalog: row.allow_multi_catalog,
+ supports_schemas:
+ (row as any).engine_information?.supports_schemas !== false,
order,
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>TypeScript any type violation</b></div>
<div id="fix">
The use of `as any` violates the repository's TypeScript standards that prohibit `any` types. Consider defining a proper interface for the API response or using a type assertion that extends DatabaseObject.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
supports_schemas:
(row as DatabaseObject & { engine_information?: { supports_schemas?: boolean } }).engine_information?.supports_schemas !== false,
order,
````
</div>
</details>
</div>
<details>
<summary><b>Citations</b></summary>
<ul>
<li>
Rule Violated: <a href="https://github.com/apache/superset/blob/93b16df/.cursor/rules/dev-standard.mdc#L16">dev-standard.mdc:16</a>
</li>
</ul>
</details>
<small><i>Code Review Run #f15404</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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] feat: support creating datasets for schema-less databases [superset]
Posted by "vgvoleg (via GitHub)" <gi...@apache.org>.
vgvoleg commented on PR #39433:
URL: https://github.com/apache/superset/pull/39433#issuecomment-4286654291
small screencast:
https://github.com/user-attachments/assets/9091abc0-e2dd-41f0-a466-103a26684d39
--
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] feat: support creating datasets for schema-less databases [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #39433:
URL: https://github.com/apache/superset/pull/39433#issuecomment-4318400561
Thanks @vgvoleg - I'll take a closer look soon, and @betodealmeida is a subject matter expert here. In the meantime, can you address pre-commit failures and address bot review comments one way or another? Thanks :D
--
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] feat: support creating datasets for schema-less databases [superset]
Posted by "betodealmeida (via GitHub)" <gi...@apache.org>.
betodealmeida merged PR #39433:
URL: https://github.com/apache/superset/pull/39433
--
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] feat: support creating datasets for schema-less databases [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 #39433:
URL: https://github.com/apache/superset/pull/39433#discussion_r3099855464
##########
superset-frontend/src/components/DatabaseSelector/index.tsx:
##########
@@ -254,6 +255,8 @@ export function DatabaseSelector({
database_name: row.database_name,
backend: row.backend,
allow_multi_catalog: row.allow_multi_catalog,
+ supports_schemas:
+ (row as any).engine_information?.supports_schemas !== false,
Review Comment:
**Suggestion:** Replace the `any` cast with a concrete intersection type that explicitly models `engine_information.supports_schemas`. [custom_rule]
**Severity Level:** Minor ⚠️
```suggestion
(
row as DatabaseObject & {
engine_information?: { supports_schemas?: boolean };
}
).engine_information?.supports_schemas !== false,
```
<details>
<summary><b>Why it matters? 🤔 </b></summary>
The existing code does use an `any` cast, so the typing rule violation is real. The improved code replaces `any` with a concrete intersection type that models the optional `engine_information.supports_schemas` field, preserving the same runtime behavior while improving type safety. The syntax is valid TypeScript, and the referenced `DatabaseObject` type already exists in the file's imports.
</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%2Fcomponents%2FDatabaseSelector%2Findex.tsx%0A%2A%2ALine%3A%2A%2A%20259%3A259%0A%2A%2AComment%3A%2A%2A%0A%09%2ACustom%20Rule%3A%20Replace%20the%20%60any%60%20cast%20with%20a%20concrete%20intersection%20type%20that%20explicitly%20models%20%60engine_information.supports_schemas%60.%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.%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%2Fcomponents%2FDatabaseSelector%2Findex.tsx%0A%2A%2ALine%3A%2A%2A%20259%3A259%0A%2A%2AComment%3A%2A%2A%0A%09%2ACustom%20Rule%
3A%20Replace%20the%20%60any%60%20cast%20with%20a%20concrete%20intersection%20type%20that%20explicitly%20models%20%60engine_information.supports_schemas%60.%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.%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/components/DatabaseSelector/index.tsx
**Line:** 259:259
**Comment:**
*Custom Rule: Replace the `any` cast with a concrete intersection type that explicitly models `engine_information.supports_schemas`.
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.
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39433&comment_hash=725bc2959e1140edbc3bfe98d732ef0e6e111b1687ba5c5c8c05437bc53d284a&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39433&comment_hash=725bc2959e1140edbc3bfe98d732ef0e6e111b1687ba5c5c8c05437bc53d284a&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] feat: support creating datasets for schema-less databases [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39433:
URL: https://github.com/apache/superset/pull/39433#issuecomment-4267554404
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] feat: support creating datasets for schema-less databases [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 #39433:
URL: https://github.com/apache/superset/pull/39433#discussion_r3107324933
##########
superset-frontend/src/components/DatabaseSelector/index.tsx:
##########
@@ -185,6 +185,7 @@ export function DatabaseSelector({
}: DatabaseSelectorProps) {
const showCatalogSelector = !!db?.allow_multi_catalog;
const [currentDb, setCurrentDb] = useState<DatabaseValue | undefined>();
+ const showSchemaSelector = currentDb?.supports_schemas !== false;
Review Comment:
**Suggestion:** The schema visibility check relies only on local state, but that state is intentionally not refreshed when the selected database id stays the same, so capability updates (like schema-less engines coming from API/local storage sync) are ignored and the schema selector can stay visible incorrectly. Use the latest `db` prop as the primary source and only fall back to local state. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ SQL Lab left-bar still shows schema for schema-less engines.
- ⚠️ UI misreports database capabilities after configuration changes.
- ⚠️ Schema-dependent flows may behave inconsistently between selectors.
```
</details>
```suggestion
const showSchemaSelector =
(db?.supports_schemas ?? currentDb?.supports_schemas) !== false;
```
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Open SQL Lab so the left bar renders `SqlEditorLeftBar` at
`superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx:65-81`, which in turn
renders a persistent `DatabaseSelector` (line 73) passed `db` from `useDatabaseSelector`.
2. Note that `useDatabaseSelector` at
`superset-frontend/src/SqlLab/components/SqlEditorTopBar/useDatabaseSelector.ts:40-54`
derives `database` from the Redux `databases` map, and `handleDbList` at lines 87-92
dispatches `setDatabases(result as Database[])` when the inner selector fetches databases.
3. Open the "Select Database and Schema" popover in the left bar, which renders a second
`DatabaseSelector` at `SqlEditorLeftBar/index.tsx:20-40`; this inner selector calls
`loadDatabases` at `DatabaseSelector/index.tsx:208-275`, which hits `/api/v1/database`,
maps `engine_information.supports_schemas` into each result option (lines 246-265), and
passes the raw `result` array to `getDbList`, causing `setDatabases` to refresh the Redux
`databases` entry for the currently selected DB id with updated `supports_schemas`.
4. After Redux is updated, `useDatabaseSelector`'s effect at
`useDatabaseSelector.ts:101-114` updates `userSelectedDb` (and thus the `db` prop passed
to the persistent left-bar `DatabaseSelector`) to the new object (with
`supports_schemas=false` for a schema-less engine), but inside `DatabaseSelector` the
`useEffect` at `DatabaseSelector/index.tsx:276-293` only updates `currentDb` when the id
changes (`current?.id !== db?.id`), so `currentDb` retains the old `supports_schemas`
value while `showSchemaSelector` at line 188 still uses `currentDb?.supports_schemas !==
false`, leaving the schema selector visible even though the latest `db` prop indicates a
schema-less engine.
```
</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%2Fcomponents%2FDatabaseSelector%2Findex.tsx%0A%2A%2ALine%3A%2A%2A%20188%3A188%0A%2A%2AComment%3A%2A%2A%0A%09%2ALogic%20Error%3A%20The%20schema%20visibility%20check%20relies%20only%20on%20local%20state%2C%20but%20that%20state%20is%20intentionally%20not%20refreshed%20when%20the%20selected%20database%20id%20stays%20the%20same%2C%20so%20capability%20updates%20%28like%20schema-less%20engines%20coming%20from%20API%2Flocal%20storage%20sync%29%20are%20ignored%20and%20the%20schema%20selector%20can%20stay%20visible%20incorrectly.%20Use%20the%20latest%20%60db%60%20prop%20as%20the%20primary%20source%20and%20only%20fall%20back%20to%20local%20state.%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%2
0and%20please%20make%20it%20concise.%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%2Fcomponents%2FDatabaseSelector%2Findex.tsx%0A%2A%2ALine%3A%2A%2A%20188%3A188%0A%2A%2AComment%3A%2A%2A%0A%09%2ALogic%20Error%3A%20The%20schema%20visibility%20check%20relies%20only%20on%20local%20state%2C%20but%20that%20state%20is%20intentionally%20not%20refreshed%20when%20the%20selected%20database%20id%20stays%20the%20same%2C%20so%20capability%20updates%20%28like%20schema-less%20engines%20coming%20from%20API%2Flocal%20storage%20sync%29%20are%20ignored%20and%20the%20schema%20selector%20can%20stay%20visible%20incorrectly.%20Use%20the%20latest%20%60db%60%20prop%20as%20the%20primary%20source%20and%20only%20fall%20back%20to%20local%20state.%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.%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/components/DatabaseSelector/index.tsx
**Line:** 188:188
**Comment:**
*Logic Error: The schema visibility check relies only on local state, but that state is intentionally not refreshed when the selected database id stays the same, so capability updates (like schema-less engines coming from API/local storage sync) are ignored and the schema selector can stay visible incorrectly. Use the latest `db` prop as the primary source and only fall back to local state.
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.
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39433&comment_hash=b351bc227f3939443c7544622bea25182482a6b88303a37f2220c9787ae4ff48&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39433&comment_hash=b351bc227f3939443c7544622bea25182482a6b88303a37f2220c9787ae4ff48&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] feat: support creating datasets for schema-less databases [superset]
Posted by "vgvoleg (via GitHub)" <gi...@apache.org>.
vgvoleg commented on PR #39433:
URL: https://github.com/apache/superset/pull/39433#issuecomment-4318525363
> Thanks @vgvoleg - I'll take a closer look soon, and @betodealmeida is a subject matter expert here. In the meantime, can you address pre-commit failures and address bot review comments one way or another? Thanks :D
everything fixed!
--
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