Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro committed Mar 31, 2023
1 parent de0c2bf commit 3a8b4db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,17 +1006,17 @@ def adhoc_metric_to_sqla(

return self.make_sqla_column_compatible(sqla_metric, label)

def adhoc_column_to_sqla(
def adhoc_column_to_sqla( # pylint: disable=too-many-locals
self,
col: AdhocColumn,
force_check_expression: bool = False,
force_type_check: bool = False,
template_processor: Optional[BaseTemplateProcessor] = None,
) -> ColumnElement:
"""
Turn an adhoc column into a sqlalchemy column.
:param col: Adhoc column definition
:param force_check_expression: Should the expression be checked in the db.
:param force_type_check: Should the column type be checked in the db.
This is needed to validate if a filter with an adhoc column
is applicable.
:param template_processor: template_processor instance
Expand All @@ -1041,7 +1041,7 @@ def adhoc_column_to_sqla(
is_dttm = col_in_metadata.is_temporal
else:
sqla_column = literal_column(expression)
if has_timegrain or force_check_expression:
if has_timegrain or force_type_check:
try:
# probe adhoc column type
tbl, _ = self.get_from_clause(template_processor)
Expand Down Expand Up @@ -1464,7 +1464,7 @@ def get_sqla_query( # pylint: disable=too-many-arguments,too-many-locals,too-ma
try:
sqla_col = self.adhoc_column_to_sqla(
col=flt_col,
force_check_expression=True,
force_type_check=True,
template_processor=template_processor,
)
applied_adhoc_filters_columns.append(flt_col)
Expand Down
2 changes: 1 addition & 1 deletion superset/utils/pandas_postprocessing/pivot.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


@validate_column_args("index", "columns")
def pivot( # pylint: disable=too-many-arguments,too-many-locals
def pivot( # pylint: disable=too-many-arguments
df: DataFrame,
index: List[str],
aggregates: Dict[str, Dict[str, Any]],
Expand Down

0 comments on commit 3a8b4db

Please sign in to comment.