feat(examples): Modernize example data loading with Parquet and YAML configs (#36538)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Evan Rusackas
2026-01-21 12:42:15 -08:00
committed by GitHub
parent ec36791551
commit dee063a4c5
271 changed files with 23340 additions and 12971 deletions

View File

@@ -34,7 +34,7 @@ from superset.utils import json
logger = logging.getLogger(__name__)
def import_database(
def import_database( # noqa: C901
config: dict[str, Any],
overwrite: bool = False,
ignore_permissions: bool = False,
@@ -59,8 +59,14 @@ def import_database(
except SupersetSecurityException as exc:
raise ImportFailedError(exc.message) from exc
# https://github.com/apache/superset/pull/16756 renamed ``csv`` to ``file``.
config["allow_file_upload"] = config.pop("allow_csv_upload")
if "schemas_allowed_for_csv_upload" in config["extra"]:
# Handle both old and new field names, defaulting to True for examples database
if "allow_csv_upload" in config:
config["allow_file_upload"] = config.pop("allow_csv_upload")
elif "allow_file_upload" not in config:
# Default to True for backward compatibility
config["allow_file_upload"] = True
if "schemas_allowed_for_csv_upload" in config.get("extra", {}):
config["extra"]["schemas_allowed_for_file_upload"] = config["extra"].pop(
"schemas_allowed_for_csv_upload"
)