Skip to content

Commit

Permalink
Merge pull request #124 from stat-kwon/master
Browse files Browse the repository at this point in the history
Add error logic when DataTable is UNAVAILABLE during load
  • Loading branch information
stat-kwon authored Dec 16, 2024
2 parents 738c37c + 9339d95 commit a7600ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/spaceone/dashboard/error/data_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ class ERROR_NOT_SUPPORTED_OPERATOR(ERROR_INVALID_ARGUMENT):
_message = "Data table does not support operator. (operator = {operator})"


class ERROR_UNAVAILABLE_DATA_TABLE(ERROR_INVALID_ARGUMENT):
_message = "Data table is not available. (data_table_id = {data_table_id})"


class ERROR_DUPLICATED_DATA_FIELDS(ERROR_INVALID_ARGUMENT):
_message = "Data fields for join are duplicated. (fields = {fields})"

Expand Down
6 changes: 6 additions & 0 deletions src/spaceone/dashboard/service/public_data_table_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from spaceone.core.service import *
from spaceone.core.error import *
from spaceone.dashboard.error.data_table import ERROR_UNAVAILABLE_DATA_TABLE
from spaceone.dashboard.manager.public_data_table_manager import PublicDataTableManager
from spaceone.dashboard.manager.public_widget_manager import PublicWidgetManager
from spaceone.dashboard.manager.data_table_manager.data_source_manager import (
Expand Down Expand Up @@ -393,6 +394,11 @@ def load(self, params: PublicDataTableLoadRequest) -> dict:
)
)

if pub_data_table_vo.state == "UNAVAILABLE":
raise ERROR_UNAVAILABLE_DATA_TABLE(
data_table_id=pub_data_table_vo.data_table_id
)

if pub_data_table_vo.data_type == "ADDED":
ds_mgr = DataSourceManager(
"PUBLIC",
Expand Down

0 comments on commit a7600ba

Please sign in to comment.