Skip to content

Commit

Permalink
pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurnewase committed Sep 29, 2022
1 parent 877ac2f commit 65968cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions superset/common/query_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class QueryContext:
enforce_numerical_metrics: ClassVar[bool] = True

datasource: BaseDatasource
slice: Optional[Slice] = None
slice_: Optional[Slice] = None
queries: List[QueryObject]
form_data: Optional[Dict[str, Any]]
result_type: ChartDataResultType
Expand All @@ -66,7 +66,7 @@ def __init__(
*,
datasource: BaseDatasource,
queries: List[QueryObject],
slice: Optional[Slice],
slice_: Optional[Slice],
form_data: Optional[Dict[str, Any]],
result_type: ChartDataResultType,
result_format: ChartDataResultFormat,
Expand All @@ -75,7 +75,7 @@ def __init__(
cache_values: Dict[str, Any],
) -> None:
self.datasource = datasource
self.slice = slice
self.slice_ = slice_
self.result_type = result_type
self.result_format = result_format
self.queries = queries
Expand All @@ -102,8 +102,8 @@ def get_payload(
def get_cache_timeout(self) -> Optional[int]:
if self.custom_cache_timeout is not None:
return self.custom_cache_timeout
if self.slice and self.slice.cache_timeout is not None:
return self.slice.cache_timeout
if self.slice_ and self.slice_.cache_timeout is not None:
return self.slice_.cache_timeout
if self.datasource.cache_timeout is not None:
return self.datasource.cache_timeout
if hasattr(self.datasource, "database"):
Expand Down
6 changes: 3 additions & 3 deletions superset/common/query_context_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def create(
if datasource:
datasource_model_instance = self._convert_to_model(datasource)

slice = None
slice_ = None
if form_data and form_data.get("slice_id") is not None:
slice = self._get_slice(form_data.get("slice_id"))
slice_ = self._get_slice(form_data.get("slice_id"))

result_type = result_type or ChartDataResultType.FULL
result_format = result_format or ChartDataResultFormat.JSON
Expand All @@ -79,7 +79,7 @@ def create(
return QueryContext(
datasource=datasource_model_instance,
queries=queries_,
slice=slice,
slice_=slice_,
form_data=form_data,
result_type=result_type,
result_format=result_format,
Expand Down

0 comments on commit 65968cc

Please sign in to comment.