Skip to content

fix(uploads): set catalog on datasets created by file upload - #43301

Open
vhogberg wants to merge 2 commits into
apache:masterfrom
vhogberg:fix/upload-catalog
Open

fix(uploads): set catalog on datasets created by file upload#43301
vhogberg wants to merge 2 commits into
apache:masterfrom
vhogberg:fix/upload-catalog

Conversation

@vhogberg

Copy link
Copy Markdown
Contributor

SUMMARY

Fixes #43300

In UploadCommand.run() when creating the SqlaTable record, it never set catalog before:

sqla_table = SqlaTable(
    table_name=self._table_name,
    database=self._model,
    database_id=self._model_id,
    owners=[get_user()],
    schema=self._schema,
    # ← catalog is never set
)

So, set catalog=self._model.get_default_catalog() when constructing the SqlaTable, mirroring what CreateDatasetCommand already does.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — no UI changes.

TESTING INSTRUCTIONS

Automated: test_csv_upload_dataset_catalog in tests/integration_tests/databases/commands/upload_test.py

Manual:

  1. Connect a PostgreSQL database, enable Allow file uploads to database and
    allow the public schema.
  2. Create a role with can_upload on Database plus schema_access on
    public, and assign it to a non-admin user.
  3. As that user, upload a CSV into public.
  4. Confirm the new dataset appears in the Datasets list, and that a chart
    created from it appears in the Charts list.

ADDITIONAL INFORMATION

@dosubot dosubot Bot added change:backend Requires changing the backend data:dataset Related to dataset configurations labels Aug 18, 2026
@bito-code-review

bito-code-review Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #34ac8d

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 0a8a5ed..0a8a5ed
    • superset/commands/database/uploaders/base.py
    • tests/integration_tests/databases/commands/upload_test.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ 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

@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.63%. Comparing base (936f073) to head (459ea15).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #43301   +/-   ##
=======================================
  Coverage   66.63%   66.63%           
=======================================
  Files        2874     2874           
  Lines      163887   163887           
  Branches    37816    37816           
=======================================
  Hits       109209   109209           
  Misses      52535    52535           
  Partials     2143     2143           
Flag Coverage Δ
hive 38.11% <ø> (ø)
mysql 57.79% <ø> (ø)
postgres 57.83% <ø> (ø)
presto 40.05% <ø> (ø)
python 59.21% <ø> (ø)
sqlite 57.46% <ø> (ø)
unit 100.00% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

@bito-code-review

bito-code-review Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #40a7ec

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 0a8a5ed..459ea15
    • superset/commands/database/uploaders/base.py
    • tests/integration_tests/databases/commands/upload_test.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ 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

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

Labels

change:backend Requires changing the backend data:dataset Related to dataset configurations size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSV/Excel/Columnar upload can create datasets without a set catalog, producing an inconsistent schema_perm

1 participant