-
Notifications
You must be signed in to change notification settings - Fork 16.6k
fix(examples): skip URI safety check for system imports #37577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix(examples): skip URI safety check for system imports #37577
Conversation
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>
Code Review Agent Run #e86607Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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>
SUMMARY
PR #36538 modernized example loading to use the import/export framework, routing through
import_database(). This function checksPREVENT_UNSAFE_DB_CONNECTIONS, which blocks SQLite URIs. In CI/showtime environments where this flag is enabled andSQLALCHEMY_EXAMPLES_URIis SQLite, example loading now fails with: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
PREVENT_UNSAFE_DB_CONNECTIONS = TrueandSQLALCHEMY_EXAMPLES_URIto a SQLite URIsuperset load-examplesSupersetSecurityExceptionADDITIONAL INFORMATION
🤖 Generated with Claude Code