mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
chore(database): Creating helper make_url_safe to wrap potential errors (#19526)
* Creating helper make_url_safe to wrap potential errors * Fixing imports * Fixing imports again * Adding comment * Linting * Fixing test * Fixing test again... * Fixing import
This commit is contained in:
@@ -74,9 +74,8 @@ if feature_flags.get("VERSIONED_EXPORT"):
|
||||
from superset.dashboards.commands.export import ExportDashboardsCommand
|
||||
from superset.models.dashboard import Dashboard
|
||||
|
||||
g.user = security_manager.find_user( # pylint: disable=assigning-non-slot
|
||||
username="admin"
|
||||
)
|
||||
# pylint: disable=assigning-non-slot
|
||||
g.user = security_manager.find_user(username="admin")
|
||||
|
||||
dashboard_ids = [id_ for (id_,) in db.session.query(Dashboard.id).all()]
|
||||
timestamp = datetime.now().strftime("%Y%m%dT%H%M%S")
|
||||
@@ -110,9 +109,8 @@ if feature_flags.get("VERSIONED_EXPORT"):
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.datasets.commands.export import ExportDatasetsCommand
|
||||
|
||||
g.user = security_manager.find_user( # pylint: disable=assigning-non-slot
|
||||
username="admin"
|
||||
)
|
||||
# pylint: disable=assigning-non-slot
|
||||
g.user = security_manager.find_user(username="admin")
|
||||
|
||||
dataset_ids = [id_ for (id_,) in db.session.query(SqlaTable.id).all()]
|
||||
timestamp = datetime.now().strftime("%Y%m%dT%H%M%S")
|
||||
@@ -153,9 +151,8 @@ if feature_flags.get("VERSIONED_EXPORT"):
|
||||
)
|
||||
|
||||
if username is not None:
|
||||
g.user = security_manager.find_user( # pylint: disable=assigning-non-slot
|
||||
username=username
|
||||
)
|
||||
# pylint: disable=assigning-non-slot
|
||||
g.user = security_manager.find_user(username=username)
|
||||
if is_zipfile(path):
|
||||
with ZipFile(path) as bundle:
|
||||
contents = get_contents_from_bundle(bundle)
|
||||
@@ -320,9 +317,8 @@ else:
|
||||
elif path_object.exists() and recursive:
|
||||
files.extend(path_object.rglob("*.json"))
|
||||
if username is not None:
|
||||
g.user = security_manager.find_user( # pylint: disable=assigning-non-slot
|
||||
username=username
|
||||
)
|
||||
# pylint: disable=assigning-non-slot
|
||||
g.user = security_manager.find_user(username=username)
|
||||
contents = {}
|
||||
for path_ in files:
|
||||
with open(path_) as file:
|
||||
|
||||
Reference in New Issue
Block a user