fix(api): prefix class names on events actions (#12354)
* fix(api): prefix class names on events actions * fix bulk delete
This commit is contained in:
parent
078a8a17a1
commit
0f731f27e4
|
|
@ -112,8 +112,11 @@ class AnnotationLayerRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.delete",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
@permission_name("delete")
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
def delete(self, pk: int) -> Response:
|
||||
"""Delete an annotation layer
|
||||
---
|
||||
|
|
@ -163,7 +166,10 @@ class AnnotationLayerRestApi(BaseSupersetModelRestApi):
|
|||
@safe
|
||||
@statsd_metrics
|
||||
@permission_name("post")
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.post",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def post(self) -> Response:
|
||||
"""Creates a new Annotation Layer
|
||||
---
|
||||
|
|
@ -223,7 +229,10 @@ class AnnotationLayerRestApi(BaseSupersetModelRestApi):
|
|||
@safe
|
||||
@statsd_metrics
|
||||
@permission_name("put")
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.put",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def put(self, pk: int) -> Response:
|
||||
"""Updates an Annotation Layer
|
||||
---
|
||||
|
|
@ -290,7 +299,10 @@ class AnnotationLayerRestApi(BaseSupersetModelRestApi):
|
|||
@safe
|
||||
@statsd_metrics
|
||||
@rison(get_delete_ids_schema)
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.bulk_delete",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def bulk_delete(self, **kwargs: Any) -> Response:
|
||||
"""Delete bulk Annotation layers
|
||||
---
|
||||
|
|
|
|||
|
|
@ -225,7 +225,10 @@ class ChartRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.post",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def post(self) -> Response:
|
||||
"""Creates a new Chart
|
||||
---
|
||||
|
|
@ -282,7 +285,10 @@ class ChartRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.put",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def put(self, pk: int) -> Response:
|
||||
"""Changes a Chart
|
||||
---
|
||||
|
|
@ -356,7 +362,10 @@ class ChartRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.delete",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def delete(self, pk: int) -> Response:
|
||||
"""Deletes a Chart
|
||||
---
|
||||
|
|
@ -407,7 +416,10 @@ class ChartRestApi(BaseSupersetModelRestApi):
|
|||
@safe
|
||||
@statsd_metrics
|
||||
@rison(get_delete_ids_schema)
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.bulk_delete",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def bulk_delete(self, **kwargs: Any) -> Response:
|
||||
"""Delete bulk Charts
|
||||
---
|
||||
|
|
@ -495,7 +507,10 @@ class ChartRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.data",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def data(self) -> Response:
|
||||
"""
|
||||
Takes a query context constructed in the client and returns payload
|
||||
|
|
@ -571,10 +586,14 @@ class ChartRestApi(BaseSupersetModelRestApi):
|
|||
return self.get_data_response(command)
|
||||
|
||||
@expose("/data/<cache_key>", methods=["GET"])
|
||||
@event_logger.log_this
|
||||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}"
|
||||
f".data_from_cache",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def data_from_cache(self, cache_key: str) -> Response:
|
||||
"""
|
||||
Takes a query context cache key and returns payload
|
||||
|
|
@ -629,7 +648,11 @@ class ChartRestApi(BaseSupersetModelRestApi):
|
|||
@rison(screenshot_query_schema)
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}"
|
||||
f".cache_screenshot",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def cache_screenshot(self, pk: int, **kwargs: Dict[str, bool]) -> WerkzeugResponse:
|
||||
"""
|
||||
---
|
||||
|
|
@ -701,7 +724,10 @@ class ChartRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.screenshot",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def screenshot(self, pk: int, digest: str) -> WerkzeugResponse:
|
||||
"""Get Chart screenshot
|
||||
---
|
||||
|
|
@ -755,7 +781,10 @@ class ChartRestApi(BaseSupersetModelRestApi):
|
|||
@rison(thumbnail_query_schema)
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.thumbnail",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def thumbnail(
|
||||
self, pk: int, digest: str, **kwargs: Dict[str, bool]
|
||||
) -> WerkzeugResponse:
|
||||
|
|
@ -829,7 +858,10 @@ class ChartRestApi(BaseSupersetModelRestApi):
|
|||
@safe
|
||||
@statsd_metrics
|
||||
@rison(get_export_ids_schema)
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.export",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def export(self, **kwargs: Any) -> Response:
|
||||
"""Export charts
|
||||
---
|
||||
|
|
@ -885,9 +917,13 @@ class ChartRestApi(BaseSupersetModelRestApi):
|
|||
@expose("/favorite_status/", methods=["GET"])
|
||||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@rison(get_fav_star_ids_schema)
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}"
|
||||
f".favorite_status",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def favorite_status(self, **kwargs: Any) -> Response:
|
||||
"""Favorite stars for Charts
|
||||
---
|
||||
|
|
@ -932,6 +968,10 @@ class ChartRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.import_",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def import_(self) -> Response:
|
||||
"""Import chart(s) with associated datasets and databases
|
||||
---
|
||||
|
|
|
|||
|
|
@ -89,8 +89,11 @@ class CssTemplateRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.bulk_delete",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
@rison(get_delete_ids_schema)
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
def bulk_delete(self, **kwargs: Any) -> Response:
|
||||
"""Delete bulk CSS Templates
|
||||
---
|
||||
|
|
|
|||
|
|
@ -214,7 +214,10 @@ class DashboardRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.post",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def post(self) -> Response:
|
||||
"""Creates a new Dashboard
|
||||
---
|
||||
|
|
@ -273,7 +276,10 @@ class DashboardRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.put",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def put(self, pk: int) -> Response:
|
||||
"""Changes a Dashboard
|
||||
---
|
||||
|
|
@ -344,7 +350,10 @@ class DashboardRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.delete",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def delete(self, pk: int) -> Response:
|
||||
"""Deletes a Dashboard
|
||||
---
|
||||
|
|
@ -395,7 +404,10 @@ class DashboardRestApi(BaseSupersetModelRestApi):
|
|||
@safe
|
||||
@statsd_metrics
|
||||
@rison(get_delete_ids_schema)
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.bulk_delete",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def bulk_delete(self, **kwargs: Any) -> Response:
|
||||
"""Delete bulk Dashboards
|
||||
---
|
||||
|
|
@ -453,7 +465,10 @@ class DashboardRestApi(BaseSupersetModelRestApi):
|
|||
@safe
|
||||
@statsd_metrics
|
||||
@rison(get_export_ids_schema)
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.export",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def export(self, **kwargs: Any) -> Response:
|
||||
"""Export dashboards
|
||||
---
|
||||
|
|
@ -529,7 +544,10 @@ class DashboardRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@rison(thumbnail_query_schema)
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.thumbnail",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def thumbnail(
|
||||
self, pk: int, digest: str, **kwargs: Dict[str, bool]
|
||||
) -> WerkzeugResponse:
|
||||
|
|
@ -617,7 +635,11 @@ class DashboardRestApi(BaseSupersetModelRestApi):
|
|||
@safe
|
||||
@statsd_metrics
|
||||
@rison(get_fav_star_ids_schema)
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}"
|
||||
f".favorite_status",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def favorite_status(self, **kwargs: Any) -> Response:
|
||||
"""Favorite Stars for Dashboards
|
||||
---
|
||||
|
|
@ -662,6 +684,10 @@ class DashboardRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.import_",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def import_(self) -> Response:
|
||||
"""Import dashboard(s) with associated charts/datasets/databases
|
||||
---
|
||||
|
|
|
|||
|
|
@ -181,7 +181,10 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.post",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def post(self) -> Response:
|
||||
"""Creates a new Database
|
||||
---
|
||||
|
|
@ -244,7 +247,10 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.put",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def put( # pylint: disable=too-many-return-statements, arguments-differ
|
||||
self, pk: int
|
||||
) -> Response:
|
||||
|
|
@ -318,7 +324,10 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}" f".delete",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def delete(self, pk: int) -> Response: # pylint: disable=arguments-differ
|
||||
"""Deletes a Database
|
||||
---
|
||||
|
|
@ -369,7 +378,10 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
|||
@safe
|
||||
@rison(database_schemas_query_schema)
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}" f".schemas",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def schemas(self, pk: int, **kwargs: Any) -> FlaskResponse:
|
||||
"""Get all schemas from a database
|
||||
---
|
||||
|
|
@ -424,7 +436,11 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
|||
@check_datasource_access
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}"
|
||||
f".table_metadata",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def table_metadata(
|
||||
self, database: Database, table_name: str, schema_name: str
|
||||
) -> FlaskResponse:
|
||||
|
|
@ -481,7 +497,10 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
|||
@check_datasource_access
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.select_star",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def select_star(
|
||||
self, database: Database, table_name: str, schema_name: Optional[str] = None
|
||||
) -> FlaskResponse:
|
||||
|
|
@ -538,7 +557,11 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}"
|
||||
f".test_connection",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def test_connection( # pylint: disable=too-many-return-statements
|
||||
self,
|
||||
) -> FlaskResponse:
|
||||
|
|
@ -588,7 +611,11 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}"
|
||||
f".related_objects",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def related_objects(self, pk: int) -> Response:
|
||||
"""Get charts and dashboards count associated to a database
|
||||
---
|
||||
|
|
@ -647,7 +674,10 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
|||
@safe
|
||||
@statsd_metrics
|
||||
@rison(get_export_ids_schema)
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.export",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def export(self, **kwargs: Any) -> Response:
|
||||
"""Export database(s) with associated datasets
|
||||
---
|
||||
|
|
@ -703,6 +733,10 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.import_",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def import_(self) -> Response:
|
||||
"""Import database(s) with associated datasets
|
||||
---
|
||||
|
|
|
|||
|
|
@ -186,7 +186,10 @@ class DatasetRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.post",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def post(self) -> Response:
|
||||
"""Creates a new Dataset
|
||||
---
|
||||
|
|
@ -243,7 +246,10 @@ class DatasetRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.put",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def put(self, pk: int) -> Response:
|
||||
"""Changes a Dataset
|
||||
---
|
||||
|
|
@ -325,7 +331,10 @@ class DatasetRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.delete",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def delete(self, pk: int) -> Response:
|
||||
"""Deletes a Dataset
|
||||
---
|
||||
|
|
@ -376,7 +385,10 @@ class DatasetRestApi(BaseSupersetModelRestApi):
|
|||
@safe
|
||||
@statsd_metrics
|
||||
@rison(get_export_ids_schema)
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.export",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def export(self, **kwargs: Any) -> Response:
|
||||
"""Export datasets
|
||||
---
|
||||
|
|
@ -452,7 +464,10 @@ class DatasetRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}" f".refresh",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def refresh(self, pk: int) -> Response:
|
||||
"""Refresh a Dataset
|
||||
---
|
||||
|
|
@ -502,7 +517,11 @@ class DatasetRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}"
|
||||
f".related_objects",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def related_objects(self, pk: int) -> Response:
|
||||
"""Get charts and dashboards count associated to a dataset
|
||||
---
|
||||
|
|
@ -561,7 +580,10 @@ class DatasetRestApi(BaseSupersetModelRestApi):
|
|||
@safe
|
||||
@statsd_metrics
|
||||
@rison(get_delete_ids_schema)
|
||||
@event_logger.log_this_with_context(log_to_statsd=False)
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.bulk_delete",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def bulk_delete(self, **kwargs: Any) -> Response:
|
||||
"""Delete bulk Datasets
|
||||
---
|
||||
|
|
@ -620,6 +642,10 @@ class DatasetRestApi(BaseSupersetModelRestApi):
|
|||
@protect()
|
||||
@safe
|
||||
@statsd_metrics
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.import_",
|
||||
log_to_statsd=False,
|
||||
)
|
||||
def import_(self) -> Response:
|
||||
"""Import dataset(s) with associated databases
|
||||
---
|
||||
|
|
|
|||
Loading…
Reference in New Issue