Skip to content

Conversation

@dpgaspar
Copy link
Member

SUMMARY

PR #36538 modernized example loading to use the import/export framework, routing through import_database(). This function checks PREVENT_UNSAFE_DB_CONNECTIONS, which blocks SQLite URIs. In CI/showtime environments where this flag is enabled and SQLALCHEMY_EXAMPLES_URI is SQLite, example loading now fails with:

SupersetSecurityException: SQLiteDialect_pysqlite cannot be used as a data source for security reasons.

The fix skips the URI safety check when ignore_permissions=True, since system imports (like examples) use URIs from server config (SQLALCHEMY_EXAMPLES_URI), not untrusted user input.

TESTING INSTRUCTIONS

  1. Set PREVENT_UNSAFE_DB_CONNECTIONS = True and SQLALCHEMY_EXAMPLES_URI to a SQLite URI
  2. Run superset load-examples
  3. Confirm examples load without the SupersetSecurityException

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API
  • Removes existing feature or API

🤖 Generated with Claude Code

The modernized example loading (apache#36538) routes through import_database()
which checks PREVENT_UNSAFE_DB_CONNECTIONS. This blocks SQLite examples
URIs in environments where this safety flag is enabled.

Skip the check when ignore_permissions=True, since system imports (like
examples) use URIs from server config, not untrusted user input.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

bito-code-review bot commented Jan 30, 2026

Code Review Agent Run #e86607

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: eb1573c..eb1573c
    • superset/commands/database/importers/v1/utils.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

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 documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot bot added the doc:examples Related to example datasets and dashboards label Jan 30, 2026
@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.58%. Comparing base (76d897e) to head (6162bf4).
⚠️ Report is 3572 commits behind head on master.

Files with missing lines Patch % Lines
superset/examples/data_loading.py 0.00% 2 Missing ⚠️
superset/examples/generic_loader.py 0.00% 2 Missing ⚠️
superset/commands/database/importers/v1/utils.py 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #37577      +/-   ##
==========================================
+ Coverage   60.48%   66.58%   +6.09%     
==========================================
  Files        1931      643    -1288     
  Lines       76236    49054   -27182     
  Branches     8568     5502    -3066     
==========================================
- Hits        46114    32662   -13452     
+ Misses      28017    15097   -12920     
+ Partials     2105     1295     -810     
Flag Coverage Δ
hive 41.91% <0.00%> (-7.24%) ⬇️
javascript ?
mysql 64.64% <0.00%> (?)
postgres 64.72% <0.00%> (?)
presto 41.93% <0.00%> (-11.87%) ⬇️
python 66.55% <0.00%> (+3.04%) ⬆️
sqlite 64.41% <0.00%> (?)
unit 100.00% <ø> (+42.36%) ⬆️

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.

@dpgaspar dpgaspar added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Jan 30, 2026
@github-actions github-actions bot added 🎪 eb1573c 🚦 building Environment eb1573c status: building 🎪 eb1573c 📅 2026-01-30T15-22 Environment eb1573c created at 2026-01-30T15-22 🎪 eb1573c 🤡 dpgaspar Environment eb1573c requested by dpgaspar 🎪 ⌛ 48h Environment expires after 48 hours (default) and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Jan 30, 2026
@github-actions
Copy link
Contributor

🎪 Showtime is building environment on GHA for eb1573c

@github-actions github-actions bot added 🎪 eb1573c 🚦 deploying Environment eb1573c status: deploying 🎪 eb1573c 🚦 failed Environment eb1573c status: failed and removed 🎪 eb1573c 🚦 building Environment eb1573c status: building 🎪 eb1573c 🚦 deploying Environment eb1573c status: deploying labels Jan 30, 2026
@dpgaspar dpgaspar marked this pull request as draft January 30, 2026 16:10
The generic data loader creates SqlaTable rows without the UUID from
the YAML config. When load_examples_from_configs() later tries to
import the same dataset via YAML, it looks up by UUID, misses the
existing row, and tries to INSERT a duplicate — hitting a UNIQUE
constraint on table_name.

Fix by reading the UUID from dataset YAML configs and setting it on
the SqlaTable during generic data loading, so the YAML import path
finds the existing dataset by UUID.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added 🎪 6162bf4 🚦 building Environment 6162bf4 status: building 🎪 6162bf4 📅 2026-01-30T16-49 Environment 6162bf4 created at 2026-01-30T16-49 🎪 6162bf4 🤡 dpgaspar Environment 6162bf4 requested by dpgaspar labels Jan 30, 2026
@github-actions
Copy link
Contributor

🎪 Showtime is building environment on GHA for 6162bf4

@github-actions github-actions bot added 🎪 6162bf4 🚦 deploying Environment 6162bf4 status: deploying 🎪 6162bf4 🚦 failed Environment 6162bf4 status: failed and removed 🎪 6162bf4 🚦 building Environment 6162bf4 status: building 🎪 6162bf4 🚦 deploying Environment 6162bf4 status: deploying 🎪 eb1573c 🤡 dpgaspar Environment eb1573c requested by dpgaspar 🎪 eb1573c 📅 2026-01-30T15-22 Environment eb1573c created at 2026-01-30T15-22 labels Jan 30, 2026
@github-actions github-actions bot removed 🎪 eb1573c 🚦 failed Environment eb1573c status: failed 🎪 6162bf4 📅 2026-01-30T16-49 Environment 6162bf4 created at 2026-01-30T16-49 🎪 6162bf4 🚦 failed Environment 6162bf4 status: failed 🎪 6162bf4 🤡 dpgaspar Environment 6162bf4 requested by dpgaspar labels Feb 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc:examples Related to example datasets and dashboards size/S 🎪 ⌛ 48h Environment expires after 48 hours (default)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant