chore: proper current_app.config proxy usage (#34345)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Maxime Beauchemin
2025-07-31 19:27:42 -07:00
committed by GitHub
parent 6c9cda758a
commit cb27d5fe8d
144 changed files with 1428 additions and 1119 deletions

View File

@@ -20,9 +20,10 @@ import logging
from typing import Any, cast, TypedDict
import pandas as pd
from flask import current_app as app
from flask_babel import gettext as __
from superset import app, db, results_backend, results_backend_use_msgpack
from superset import db, results_backend, results_backend_use_msgpack
from superset.commands.base import BaseCommand
from superset.errors import ErrorLevel, SupersetError, SupersetErrorType
from superset.exceptions import SupersetErrorException, SupersetSecurityException
@@ -32,8 +33,6 @@ from superset.sqllab.limiting_factor import LimitingFactor
from superset.utils import core as utils, csv
from superset.views.utils import _deserialize_results_payload
config = app.config
logger = logging.getLogger(__name__)
@@ -132,8 +131,8 @@ class SqlResultExportCommand(BaseCommand):
)[:limit]
# Manual encoding using the specified encoding (default to utf-8 if not set)
csv_string = csv.df_to_escaped_csv(df, index=False, **config["CSV_EXPORT"])
csv_data = csv_string.encode(config["CSV_EXPORT"].get("encoding", "utf-8"))
csv_string = csv.df_to_escaped_csv(df, index=False, **app.config["CSV_EXPORT"])
csv_data = csv_string.encode(app.config["CSV_EXPORT"].get("encoding", "utf-8"))
return {
"query": self._query,