Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #46229 +/- ##
==========================================
+ Coverage 56.55% 65.83% +9.27%
==========================================
Files 3140 3147 +7
Lines 219075 220068 +993
Branches 51919 52139 +220
==========================================
+ Hits 123908 144888 +20980
+ Misses 93968 71748 -22220
- Partials 1199 3432 +2233
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
e3c1867 to
d1e7d04
Compare
| supportsSchemas={dataset.db.supports_schemas} | ||
| schema={dataset.schema ?? undefined} | ||
| catalog={dataset.catalog} | ||
| onPreviewTable={onPreviewTable} |
There was a problem hiding this comment.
Suggestion: On databases without schemas, the browser supplies a synthetic empty schema; this callback stores it, and dataset creation sends schema: '', which can make registration treat it as a real schema.
Assessment: 🟠 Major · 🔁 Occurrence: Rarely · 🏷️ Api mismatch
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** superset-frontend/src/features/datasets/AddDataset/LeftPanel/index.tsx
**Line:** 100:100
**Comment:**
*Api Mismatch: On databases without schemas, the browser supplies a synthetic empty schema; this callback stores it, and dataset creation sends `schema: ''`, which can make registration treat it as a real schema.
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| new Set( | ||
| tables | ||
| .filter(({ queryEditorId: qeId }) => editorId === qeId) | ||
| .map(({ dbId, schema, name }) => `${dbId}:${schema}:${name}`), |
There was a problem hiding this comment.
Suggestion: These pin keys omit catalog, so same-named tables in separate catalogs appear pinned together; the unpin lookup can also remove the wrong catalog's entry.
Assessment: 🟠 Major · 🔁 Occurrence: Rarely · 🏷️ Logic error
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** superset-frontend/src/SqlLab/components/TableExploreTree/index.tsx
**Line:** 587:587
**Comment:**
*Logic Error: These pin keys omit `catalog`, so same-named tables in separate catalogs appear pinned together; the unpin lookup can also remove the wrong catalog's entry.
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|
We changed the white opacity selection for |
rusackas
left a comment
There was a problem hiding this comment.
Thanks @Haseeb702, nice to see SQL Lab and the dataset page sharing one browser!
One thing before approving... the old SQL Lab popover sent '' when the schema was cleared, but applySelection passes undefined, and the tab-state PUT skips undefined fields (here). So switching databases without picking a schema seems like it'd leave the old schema saved server-side. Mind keeping the '' on the SQL Lab path?
Also, was dropping the "This table already has a dataset" marker from the table list intentional? The footer still blocks it, but the hint was handy.
|
Hi @rusackas, thanks for the feedback! We added back the |
rusackas
left a comment
There was a problem hiding this comment.
Thanks @Haseeb702 for turning those two around! I gave it a deeper pass and found one more thing on the SQL Lab side. DatabaseSelectorPopover pulls onDbChange/onCatalogChange/onSchemaChange out of the props before handing the rest to the trigger DatabaseSelector, so the trigger's auto-select and clear-stale-schema logic no longer reports back to anyone. An editor on a database with a single schema would stay schema-less, and a saved schema that no longer exists would stick around until someone opens the popover. Could the trigger keep those callbacks?
Couple of smaller ones on the dataset page inline.
| const schemaId = dbId && schema ? `schema:${dbId}:${schema}` : undefined; | ||
| if (revealedSchemaRef.current === schemaId) return; | ||
| revealedSchemaRef.current = schemaId; | ||
| setSearchTerm(''); |
There was a problem hiding this comment.
This clears the filter whenever schema changes, and on the dataset page clicking a table under another schema changes it. So filtering for orders and clicking the match under sales wipes the search right after the click. Maybe only reset it when the schema change didn't come from the tree itself?
There was a problem hiding this comment.
Done, updated TableBrowser to record when a schema changes so that it resets when schema change didn't come from the tree.
| <Divider style={{ margin: 0 }} /> | ||
| {dataset?.db ? ( | ||
| <TableBrowser | ||
| key={`${dataset.db.id}:${dataset.catalog ?? ''}`} |
There was a problem hiding this comment.
Since this is only keyed on db/catalog, the tree never hears that table_name got cleared (e.g. after picking another schema in the popover). The old table stays highlighted and expanded while the panel shows nothing selected. Passing the selected table down should keep the two in sync.
There was a problem hiding this comment.
Added a selectedTable prop so that when table_name is cleared, the tree closes and deselects the old table.
| opacity: ${columnOpacity}; | ||
| `} | ||
| data-selected={node.isSelected} | ||
| onClick={() => node.select()} |
There was a problem hiding this comment.
In preview mode, clicking a column selects it, which deselects the table, so the table dims even though it's still the dataset's table. Should column clicks skip node.select() here?
There was a problem hiding this comment.
Done. We made the column click skip when in preview mode.
|
Thanks for the detailed review @rusackas! We looked over the review comments and made some fixes to the code based on your feedback. |
SUMMARY
The dataset creation page uses a different table selection UI compared to SQL Lab. This PR makes the two pages more consistent with each other by reusing SQL Lab components in
dataset/add.Users can now select a database connection and schema, and select a table to preview in a refined table browser reused from SQL Labs. The existing single dataset registration still functions the same.
This PR addresses the UI portion of the bulk import issue in #46230 and provides a foundation to add multi table import in a follow up PR.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
After
Data Connection/Schema
Table Browser Selector
TESTING INSTRUCTIONS
dataset/addpage and click the database connection selectorcreate and exploredataset if the table already has a dataset associated with it. Try selectingcreate and explore datasetbutton and see if it brings the user to the chart creation screen.ADDITIONAL INFORMATION