You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by be...@apache.org on 2023/12/06 19:23:03 UTC
(superset) branch improve-has_table_query created (now d0a4613177)
This is an automated email from the ASF dual-hosted git repository.
beto pushed a change to branch improve-has_table_query
in repository https://gitbox.apache.org/repos/asf/superset.git
at d0a4613177 Fix lint
This branch includes the following new commits:
new d0a4613177 Fix lint
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(superset) 01/01: Fix lint
Posted by be...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
beto pushed a commit to branch improve-has_table_query
in repository https://gitbox.apache.org/repos/asf/superset.git
commit d0a46131777e99c2b3e59820d8f0270d3ea0934b
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Wed Dec 6 14:07:14 2023 -0500
Fix lint
---
superset/connectors/sqla/models.py | 5 +----
superset/models/helpers.py | 2 +-
superset/models/sql_lab.py | 3 ++-
superset/views/datasource/utils.py | 2 +-
4 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/superset/connectors/sqla/models.py b/superset/connectors/sqla/models.py
index f67036b0b6..401eca7fe8 100644
--- a/superset/connectors/sqla/models.py
+++ b/superset/connectors/sqla/models.py
@@ -87,10 +87,8 @@ from superset.db_engine_specs.base import BaseEngineSpec, TimestampExpression
from superset.exceptions import (
ColumnNotFoundException,
DatasetInvalidPermissionEvaluationException,
- QueryClauseValidationException,
QueryObjectValidationError,
SupersetGenericDBErrorException,
- SupersetSecurityException,
)
from superset.jinja_context import (
BaseTemplateProcessor,
@@ -107,10 +105,9 @@ from superset.models.helpers import (
process_sql_expression,
QueryResult,
QueryStringExtended,
- validate_adhoc_subquery,
)
from superset.models.slice import Slice
-from superset.sql_parse import ParsedQuery, sanitize_clause
+from superset.sql_parse import ParsedQuery
from superset.superset_typing import (
AdhocColumn,
AdhocMetric,
diff --git a/superset/models/helpers.py b/superset/models/helpers.py
index 35486d19a6..15bd1b15f7 100644
--- a/superset/models/helpers.py
+++ b/superset/models/helpers.py
@@ -813,7 +813,7 @@ class ExploreMixin: # pylint: disable=too-many-public-methods
self,
template_processor: Optional[ # pylint: disable=unused-argument
BaseTemplateProcessor
- ] = None, # pylint: disable=unused-argument
+ ] = None,
) -> TextClause:
return self.fetch_values_predicate
diff --git a/superset/models/sql_lab.py b/superset/models/sql_lab.py
index 7e63e984df..44d403fcca 100644
--- a/superset/models/sql_lab.py
+++ b/superset/models/sql_lab.py
@@ -52,6 +52,7 @@ from superset.models.helpers import (
ExploreMixin,
ExtraJSONMixin,
ImportExportMixin,
+ process_sql_expression,
)
from superset.sql_parse import CtasMethod, ParsedQuery, Table
from superset.sqllab.limiting_factor import LimitingFactor
@@ -345,7 +346,7 @@ class Query(
:rtype: sqlalchemy.sql.column
"""
label = get_column_name(col)
- expression = self._process_sql_expression(
+ expression = process_sql_expression(
expression=col["sqlExpression"],
database_id=self.database_id,
schema=self.schema,
diff --git a/superset/views/datasource/utils.py b/superset/views/datasource/utils.py
index 61b7cc85bc..b08d1ccc15 100644
--- a/superset/views/datasource/utils.py
+++ b/superset/views/datasource/utils.py
@@ -43,7 +43,7 @@ def get_limit_clause(page: Optional[int], per_page: Optional[int]) -> dict[str,
return {"row_offset": offset, "row_limit": limit}
-def get_samples( # pylint: disable=too-many-arguments,too-many-locals
+def get_samples( # pylint: disable=too-many-arguments
datasource_type: str,
datasource_id: int,
force: bool = False,