diff --git a/superset/sqllab/api.py b/superset/sqllab/api.py index 5a729c2634a..261134d41c5 100644 --- a/superset/sqllab/api.py +++ b/superset/sqllab/api.py @@ -506,7 +506,7 @@ class SqlLabRestApi(BaseSupersetApi): @statsd_metrics @requires_json @event_logger.log_this_with_context( - action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.get_results", + action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.post_results", log_to_statsd=False, ) def post_results(self) -> FlaskResponse: diff --git a/superset/sqllab/schemas.py b/superset/sqllab/schemas.py index 54db9f5514f..50b30e8f4a7 100644 --- a/superset/sqllab/schemas.py +++ b/superset/sqllab/schemas.py @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -from marshmallow import fields, Schema +from marshmallow import fields, Schema, validate from superset.databases.schemas import ImportV1DatabaseSchema @@ -35,6 +35,7 @@ class SqlLabResultsSchema(Schema): rows = fields.Integer( required=False, allow_none=True, + validate=validate.Range(min=1), metadata={"description": "The maximum number of rows to return"}, )