Skip to content

Conversation

@dankor
Copy link
Contributor

@dankor dankor commented Aug 24, 2025

SUMMARY

It's a followup of #29573

Added uuid support:

  • GET dataset/uuid_or_id
  • GET dataset/uuid_or_id/related_objects
  • POST chart/data {"datasource": { "id": uuid_or_id, "type": "table"}}

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

image image image

TESTING INSTRUCTIONS

Run the same request and replace id with it uuid.

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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

@github-actions github-actions bot added api Related to the REST API doc Namespace | Anything related to documentation labels Aug 24, 2025
@dosubot dosubot bot added the data:dataset Related to dataset configurations label Aug 24, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

I've completed my review and didn't find any issues.

Files scanned
File Path Reviewed
superset/daos/exceptions.py
superset/daos/datasource.py
superset/views/datasource/utils.py
superset/common/query_object_factory.py
superset/common/query_context_factory.py
superset/daos/base.py
superset/datasets/api.py
superset/charts/schemas.py
superset/utils/core.py

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

@dankor dankor changed the title UUID support in Dataset API feat(api): dataset API uuid support Aug 24, 2025
@dankor dankor force-pushed the uuid-get-dataset branch 2 times, most recently from c03a7db to f970fe4 Compare August 24, 2025 13:47
@codecov
Copy link

codecov bot commented Aug 24, 2025

Codecov Report

❌ Patch coverage is 68.18182% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.36%. Comparing base (1d9e17d) to head (1adc564).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
superset/daos/datasource.py 36.36% 6 Missing and 1 partial ⚠️
superset/daos/base.py 68.75% 3 Missing and 2 partials ⚠️
superset/datasets/api.py 81.81% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #34836       +/-   ##
===========================================
+ Coverage        0   72.36%   +72.36%     
===========================================
  Files           0      584      +584     
  Lines           0    42542    +42542     
  Branches        0     4485     +4485     
===========================================
+ Hits            0    30784    +30784     
- Misses          0    10574    +10574     
- Partials        0     1184     +1184     
Flag Coverage Δ
hive 46.83% <34.09%> (?)
mysql 71.37% <68.18%> (?)
postgres 71.44% <68.18%> (?)
presto 50.52% <38.63%> (?)
python 72.32% <68.18%> (?)
sqlite 71.00% <68.18%> (?)
unit 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dankor dankor force-pushed the uuid-get-dataset branch 4 times, most recently from 1d8a009 to 998a12b Compare August 24, 2025 14:34
@dankor dankor changed the title feat(api): dataset API uuid support feat(api): dataset read API uuid support Aug 24, 2025
@dankor
Copy link
Contributor Author

dankor commented Aug 24, 2025

@mistercrunch @michael-s-molina @rusackas
As promised, I’m continuing to add id_or_uuid support bit by bit. Please take a look.

replaced Raw with Union for uuid_or_id

Missing import

added marshmallow-union

marshmallow union
return query.filter(filter).one_or_none()
except StatementError:
# can happen if int is passed instead of a string or similar
return None
Copy link
Member

Choose a reason for hiding this comment

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

mmmh, shouldn't we either handle int or let it raise here? Not sure about what the implications are or might be...

Copy link
Member

@mistercrunch mistercrunch Aug 28, 2025

Choose a reason for hiding this comment

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

i guess mypy should complain if using an int anywhere in the codebase. Since this is a base function going to get reused it could be good to just support int here. Might even be a tiny bit cheaper to validate the type than isdigit() is, but would run both (pseudo: type(v) == int or isdigit())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, you're right, the comment is a little bit irrelevant. Fixed.

Not sure about int optimization thought. Don't we plan to deprecate id eventually?

Copy link
Member

Choose a reason for hiding this comment

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

I think you're right. Doesn't matter and mypy should catch error (would be good to confirm). While we're in here and setting the pattern, should we support short-shas in here too? Would make for nicer looking urls, pretty standard nowadays (git/github/...), not sure if it's worth the complexity, collision risks, ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why is this useful? We don’t currently expose these URLs in the UI. Maybe in the next iteration we should reintroduce the slug + short id URL style (similar to Medium), for example:

  • dashboard/unicode-test-91c65d59d37/
  • chart/unicode-cloud-b86ba33fc5cd/

That said, this looks like a complex and potentially breaking change. It could be useful for dashboards, especially as a replacement for custom slugs. But charts and datasets don’t follow the same pattern — they just redirect you to the /explore endpoint.

I’d prefer to discuss this in a different setting, since it will require some brainstorming.

Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

added a minor comment but otherwise LGTM

@dankor dankor requested a review from mistercrunch August 28, 2025 09:21
Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

LGTM

@mistercrunch mistercrunch merged commit 077724c into apache:master Aug 30, 2025
61 checks passed
sadpandajoe pushed a commit that referenced this pull request Dec 4, 2025
sadpandajoe pushed a commit that referenced this pull request Dec 4, 2025
sadpandajoe pushed a commit that referenced this pull request Dec 16, 2025
aminghadersohi pushed a commit to aminghadersohi/superset that referenced this pull request Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Related to the REST API data:dataset Related to dataset configurations doc Namespace | Anything related to documentation size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants