dosubot[bot] commented on issue #34810: URL: https://github.com/apache/superset/issues/34810#issuecomment-3213470245
<!-- Greeting --> Hi @gissel-serrala! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team. <!-- Answer --> This happens because Superset's "Sync columns from source" feature replaces all dataset columns with those detected from your SQL query. If the query fails, returns no columns, or the metadata can't be fetched, all existing columns—including those defined in your YAML—are removed. This is a destructive operation and is a known risk for virtual datasets and YAML imports [source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/connectors/sqla/models.py). Recent updates on master/latest-dev have added a checkbox in the dataset save modal that lets you skip automatic column syncing when saving, so you can avoid unwanted column removal if your SQL hasn't changed or you don't want to risk losing custom columns [source](https://github.com/apache/superset/pull/34757). If you see the "Automatically sync columns" checkbox, uncheck it before saving to keep your columns intact. If you need to sync columns, make sure your SQL query is valid and returns the expected columns—otherwise, Superset will clear out your dataset columns. There isn't official documentation on best practices yet, but this new checkbox gives you more control and helps prevent accidental data loss. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/8d459837-3343-4a70-a4fc-7bdd5ffa2fb7?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/8d459837-3343-4a70-a4fc-7bdd5ffa2fb7?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/8d459837-3343-4a70-a4fc-7bdd5ffa2fb7?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/8d459837-3343-4a70-a4fc-7bdd5ffa2fb7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8d459837-3343-4a70-a4fc-7bdd5ffa2fb7?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/8d459837-3343-4a70-a4fc-7bdd5ffa2fb7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8d459837-3343-4a70-a4fc-7bdd5ffa2fb7?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu b) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/34810) -- 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]
