mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
chore: proper current_app.config proxy usage (#34345)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
6c9cda758a
commit
cb27d5fe8d
@@ -18,11 +18,11 @@ import copy
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
from flask import current_app
|
||||
from sqlalchemy import and_, Column, Integer, String, Text
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from superset import conf
|
||||
from superset.constants import TimeGrain
|
||||
from superset.migrations.shared.utils import paginated_update, try_load_json
|
||||
from superset.utils import json
|
||||
@@ -97,7 +97,9 @@ class MigrateViz:
|
||||
def _migrate_temporal_filter(self, rv_data: dict[str, Any]) -> None:
|
||||
"""Adds a temporal filter."""
|
||||
granularity_sqla = rv_data.pop("granularity_sqla", None)
|
||||
time_range = rv_data.pop("time_range", None) or conf.get("DEFAULT_TIME_FILTER")
|
||||
time_range = rv_data.pop("time_range", None) or current_app.config.get(
|
||||
"DEFAULT_TIME_FILTER"
|
||||
)
|
||||
|
||||
if not granularity_sqla:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user