mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
chore(key-value): convert command to dao (#29344)
This commit is contained in:
@@ -21,7 +21,7 @@ from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from superset.commands.dataset.exceptions import DatasetNotFoundError
|
||||
from superset.commands.explore.permalink.base import BaseExplorePermalinkCommand
|
||||
from superset.commands.key_value.get import GetKeyValueCommand
|
||||
from superset.daos.key_value import KeyValueDAO
|
||||
from superset.explore.permalink.exceptions import ExplorePermalinkGetFailedError
|
||||
from superset.explore.permalink.types import ExplorePermalinkValue
|
||||
from superset.explore.utils import check_access as check_chart_access
|
||||
@@ -44,11 +44,7 @@ class GetExplorePermalinkCommand(BaseExplorePermalinkCommand):
|
||||
self.validate()
|
||||
try:
|
||||
key = decode_permalink_id(self.key, salt=self.salt)
|
||||
value: Optional[ExplorePermalinkValue] = GetKeyValueCommand(
|
||||
resource=self.resource,
|
||||
key=key,
|
||||
codec=self.codec,
|
||||
).run()
|
||||
value = KeyValueDAO.get_value(self.resource, key, self.codec)
|
||||
if value:
|
||||
chart_id: Optional[int] = value.get("chartId")
|
||||
# keep this backward compatible for old permalinks
|
||||
|
||||
Reference in New Issue
Block a user