mirror of
https://github.com/apache/superset.git
synced 2026-04-17 23:25:05 +00:00
chore: upgrade black (#19410)
This commit is contained in:
@@ -45,7 +45,9 @@ query_birth_names = {
|
||||
QUERY_OBJECTS: Dict[str, Dict[str, object]] = {
|
||||
"birth_names": query_birth_names,
|
||||
# `:suffix` are overrides only
|
||||
"birth_names:include_time": {"groupby": [DTTM_ALIAS, "name"],},
|
||||
"birth_names:include_time": {
|
||||
"groupby": [DTTM_ALIAS, "name"],
|
||||
},
|
||||
"birth_names:orderby_dup_alias": {
|
||||
"metrics": [
|
||||
{
|
||||
@@ -93,7 +95,9 @@ QUERY_OBJECTS: Dict[str, Dict[str, object]] = {
|
||||
],
|
||||
],
|
||||
},
|
||||
"birth_names:only_orderby_has_metric": {"metrics": [],},
|
||||
"birth_names:only_orderby_has_metric": {
|
||||
"metrics": [],
|
||||
},
|
||||
}
|
||||
|
||||
ANNOTATION_LAYERS = {
|
||||
@@ -182,17 +186,27 @@ POSTPROCESSING_OPERATIONS = {
|
||||
# https://numpy.org/doc/stable/reference/generated/numpy.percentile.html
|
||||
"options": {"q": 25, "interpolation": "lower"},
|
||||
},
|
||||
"median": {"operator": "median", "column": "sum__num",},
|
||||
"median": {
|
||||
"operator": "median",
|
||||
"column": "sum__num",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{"operation": "sort", "options": {"columns": {"q1": False, "name": True},},},
|
||||
{
|
||||
"operation": "sort",
|
||||
"options": {
|
||||
"columns": {"q1": False, "name": True},
|
||||
},
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
def get_query_object(
|
||||
query_name: str, add_postprocessing_operations: bool, add_time_offsets: bool,
|
||||
query_name: str,
|
||||
add_postprocessing_operations: bool,
|
||||
add_time_offsets: bool,
|
||||
) -> Dict[str, Any]:
|
||||
if query_name not in QUERY_OBJECTS:
|
||||
raise Exception(f"QueryObject fixture not defined for datasource: {query_name}")
|
||||
@@ -247,7 +261,9 @@ class QueryContextGenerator:
|
||||
"datasource": {"id": table.id, "type": table.type},
|
||||
"queries": [
|
||||
get_query_object(
|
||||
query_name, add_postprocessing_operations, add_time_offsets,
|
||||
query_name,
|
||||
add_postprocessing_operations,
|
||||
add_time_offsets,
|
||||
)
|
||||
],
|
||||
"result_type": ChartDataResultType.FULL,
|
||||
|
||||
Reference in New Issue
Block a user