Skip to content

Conversation

@betodealmeida
Copy link
Member

@betodealmeida betodealmeida commented Feb 3, 2026

SUMMARY

This is 4 of 4 stacked PRs to implement the backend functionality of semantic layers:

This one updates frontend to support semantic layer datasources:

  • Add SemanticView to DatasourceType enum
  • Extends DatasourceKey to handle semantic_view type
  • Updates datasource ID type to support string UUIDs
  • Updates DrillBy modal for semantic view compatibility
  • Updates explore utilities for semantic view form data

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

Tested end-to-end (all 4 PRs) with Snowflake.

ADDITIONAL INFORMATION

  • Has associated issue: [SIP-182] Semantic Layer Support in Apache Superset #35003
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

Update frontend to support semantic layer datasources:
- Add SemanticView to DatasourceType enum
- Extend DatasourceKey to handle semantic_view type
- Update datasource ID type to support string UUIDs
- Update DrillBy modal for semantic view compatibility
- Update explore utilities for semantic view form data

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Feb 3, 2026

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at evan@preset.io.

@netlify
Copy link

netlify bot commented Feb 3, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 274d1c9
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/698264103043260008db8f36
😎 Deploy Preview https://deploy-preview-37649--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

const [datasource_id, datasource_type] = formData.datasource.split('__');
const [datasourceIdStr, datasource_type] = formData.datasource.split('__');
// Try to parse as integer, fall back to string (UUID) if NaN
const parsedDatasourceId = parseInt(datasourceIdStr, 10);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn’t there going to be the same parsing problem as you mentioned in 1 of the files above (if the string starts with a number, parseInt will only extract that number)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And actually, since the id can be a string now, do we need to parse stringified numbers into integers? Cant we just leave them as strings?

@bito-code-review
Copy link
Contributor

Yes, the same parsing issue exists in DrillByModal.tsx. Using parseInt directly on datasourceIdStr could incorrectly parse strings starting with numbers (e.g., '85abc' becomes 85), unlike the fix in DatasourceKey.ts which checks if the entire string is numeric.

superset-frontend/src/components/Chart/DrillBy/DrillByModal.tsx

const [datasourceIdStr, datasource_type] = formData.datasource.split('__');
  // Try to parse as integer, fall back to string (UUID) if NaN
  const parsedDatasourceId = parseInt(datasourceIdStr, 10);
  const datasource_id = Number.isNaN(parsedDatasourceId)
    ? datasourceIdStr
    : parsedDatasourceId;

superset-frontend/packages/superset-ui-core/src/query/DatasourceKey.ts

// Only parse as integer if the entire string is numeric
    // (parseInt would incorrectly parse "85d3139f..." as 85)
    const isNumeric = /^\d+$/.test(idStr);
    this.id = isNumeric ? parseInt(idStr, 10) : idStr;

const [id, typeString] = formData.datasource.split('__');
datasourceId = parseInt(id, 10);
// Try to parse as integer, fall back to string (UUID) if NaN
const parsedId = parseInt(id, 10);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants