mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
refactor: Enable G logging rules and comprehensive ruff improvements (#35081)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
e1a2e4843a
commit
088ecdd0bf
@@ -59,7 +59,7 @@ def load_bart_lines(only_metadata: bool = False, force: bool = False) -> None:
|
||||
index=False,
|
||||
)
|
||||
|
||||
logger.debug(f"Creating table {tbl_name} reference")
|
||||
logger.debug("Creating table %s reference", tbl_name)
|
||||
table = get_table_connector_registry()
|
||||
tbl = db.session.query(table).filter_by(table_name=tbl_name).first()
|
||||
if not tbl:
|
||||
|
||||
@@ -108,7 +108,7 @@ def load_birth_names(
|
||||
table = get_table_connector_registry()
|
||||
obj = db.session.query(table).filter_by(table_name=tbl_name, schema=schema).first()
|
||||
if not obj:
|
||||
logger.debug(f"Creating table [{tbl_name}] reference")
|
||||
logger.debug("Creating table [%s] reference", tbl_name)
|
||||
obj = table(table_name=tbl_name, schema=schema)
|
||||
db.session.add(obj)
|
||||
|
||||
@@ -138,13 +138,14 @@ def _add_table_metrics(datasource: SqlaTable) -> None:
|
||||
columns.append(
|
||||
TableColumn(
|
||||
column_name="num_california",
|
||||
expression=f"CASE WHEN {col_state} = 'CA' THEN {col_num} ELSE 0 END",
|
||||
expression="CASE WHEN %s = 'CA' THEN %s ELSE 0 END"
|
||||
% (col_state, col_num),
|
||||
)
|
||||
)
|
||||
|
||||
if not any(col.metric_name == "sum__num" for col in metrics):
|
||||
col = str(column("num").compile(db.engine))
|
||||
metrics.append(SqlMetric(metric_name="sum__num", expression=f"SUM({col})"))
|
||||
metrics.append(SqlMetric(metric_name="sum__num", expression="SUM(%s)" % col))
|
||||
|
||||
for col in columns:
|
||||
if col.column_name == "ds": # type: ignore
|
||||
|
||||
@@ -84,7 +84,7 @@ def load_multiformat_time_series( # pylint: disable=too-many-locals
|
||||
logger.debug("Done loading table!")
|
||||
logger.debug("-" * 80)
|
||||
|
||||
logger.debug(f"Creating table [{tbl_name}] reference")
|
||||
logger.debug("Creating table [%s] reference", tbl_name)
|
||||
table = get_table_connector_registry()
|
||||
obj = db.session.query(table).filter_by(table_name=tbl_name).first()
|
||||
if not obj:
|
||||
@@ -125,7 +125,7 @@ def load_multiformat_time_series( # pylint: disable=too-many-locals
|
||||
}
|
||||
|
||||
slc = Slice(
|
||||
slice_name=f"Calendar Heatmap multiformat {i}",
|
||||
slice_name="Calendar Heatmap multiformat %s" % i,
|
||||
viz_type="cal_heatmap",
|
||||
datasource_type=DatasourceType.TABLE,
|
||||
datasource_id=tbl.id,
|
||||
|
||||
@@ -55,7 +55,7 @@ def load_paris_iris_geojson(only_metadata: bool = False, force: bool = False) ->
|
||||
index=False,
|
||||
)
|
||||
|
||||
logger.debug(f"Creating table {tbl_name} reference")
|
||||
logger.debug("Creating table %s reference", tbl_name)
|
||||
table = get_table_connector_registry()
|
||||
tbl = db.session.query(table).filter_by(table_name=tbl_name).first()
|
||||
if not tbl:
|
||||
|
||||
@@ -68,7 +68,7 @@ def load_random_time_series_data(
|
||||
logger.debug("Done loading table!")
|
||||
logger.debug("-" * 80)
|
||||
|
||||
logger.debug(f"Creating table [{tbl_name}] reference")
|
||||
logger.debug("Creating table [%s] reference", tbl_name)
|
||||
table = get_table_connector_registry()
|
||||
obj = db.session.query(table).filter_by(table_name=tbl_name).first()
|
||||
if not obj:
|
||||
|
||||
@@ -59,7 +59,7 @@ def load_sf_population_polygons(
|
||||
index=False,
|
||||
)
|
||||
|
||||
logger.debug(f"Creating table {tbl_name} reference")
|
||||
logger.debug("Creating table %s reference", tbl_name)
|
||||
table = get_table_connector_registry()
|
||||
tbl = db.session.query(table).filter_by(table_name=tbl_name).first()
|
||||
if not tbl:
|
||||
|
||||
Reference in New Issue
Block a user