yousoph opened a new pull request, #41106:
URL: https://github.com/apache/superset/pull/41106
## Summary
When duplicating a dataset that has a `catalog` value set (e.g. a BigQuery
dataset using multi-catalog / "Allow changing catalogs"), the cloned dataset's
`catalog` field was silently dropped and stored as `NULL`.
The root cause is that `DuplicateDatasetCommand.run()` copied `schema` from
the source dataset but never copied `catalog`, even though `catalog` is a
proper database column on `SqlaTable` (not inside `extra` JSON).
**Fix:** one line — copy `catalog` alongside `schema` in `duplicate.py`.
## Changes
- `superset/commands/dataset/duplicate.py` — add `table.catalog =
self._base_model.catalog`
- `tests/unit_tests/commands/dataset/test_duplicate.py` — new test
`test_duplicate_dataset_copies_catalog_and_schema` that mocks a base dataset
with `catalog="my-bq-project"` and asserts it is copied to the duplicate
## Test plan
- [x] New unit test `test_duplicate_dataset_copies_catalog_and_schema` passes
- [x] All 3 tests in `tests/unit_tests/commands/dataset/test_duplicate.py`
pass
- [ ] Manually: create a BQ dataset with "Allow changing catalogs" enabled,
select a catalog, duplicate the dataset, verify `GET /api/v1/dataset/{id}`
returns the correct catalog value on the clone
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]