ofekisr commented on a change in pull request #17400: URL: https://github.com/apache/superset/pull/17400#discussion_r747398923
########## File path: superset/charts/data/api.py ########## @@ -0,0 +1,365 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +from __future__ import annotations + +import json +import logging +from typing import Any, Dict, Optional, TYPE_CHECKING + +import simplejson +from flask import g, make_response, request +from flask_appbuilder.api import expose, protect +from flask_babel import gettext as _ +from marshmallow import ValidationError + +from superset import is_feature_enabled, security_manager +from superset.charts.api import ChartRestApi +from superset.charts.commands.data import ChartDataCommand +from superset.charts.commands.exceptions import ( + ChartDataCacheLoadError, + ChartDataQueryFailedError, +) +from superset.charts.post_processing import apply_post_process +from superset.common.chart_data import ChartDataResultFormat, ChartDataResultType +from superset.exceptions import QueryObjectValidationError +from superset.extensions import event_logger +from superset.utils.async_query_manager import AsyncQueryTokenException +from superset.utils.core import json_int_dttm_ser +from superset.views.base import CsvResponse, generate_download_headers +from superset.views.base_api import statsd_metrics + +if TYPE_CHECKING: + from flask import Response + +logger = logging.getLogger(__name__) + + +class ChartDataRestApi(ChartRestApi): + include_route_methods = {"get_data", "data", "data_from_cache"} Review comment: I move them here from ChartRestApi to avoid duplications and mental confusion -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
