vhogberg opened a new pull request, #43301:
URL: https://github.com/apache/superset/pull/43301

   ### 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
   
   - [x] Has associated issue: #43300 
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to