mirror of
https://github.com/apache/superset.git
synced 2026-04-20 16:44:46 +00:00
chore(key-value): use json serialization for main resources (#23888)
This commit is contained in:
@@ -18,11 +18,12 @@ from abc import ABC
|
||||
|
||||
from superset.commands.base import BaseCommand
|
||||
from superset.key_value.shared_entries import get_permalink_salt
|
||||
from superset.key_value.types import KeyValueResource, SharedKey
|
||||
from superset.key_value.types import JsonKeyValueCodec, KeyValueResource, SharedKey
|
||||
|
||||
|
||||
class BaseExplorePermalinkCommand(BaseCommand, ABC):
|
||||
resource: KeyValueResource = KeyValueResource.EXPLORE_PERMALINK
|
||||
codec = JsonKeyValueCodec()
|
||||
|
||||
@property
|
||||
def salt(self) -> str:
|
||||
|
||||
@@ -52,6 +52,7 @@ class CreateExplorePermalinkCommand(BaseExplorePermalinkCommand):
|
||||
command = CreateKeyValueCommand(
|
||||
resource=self.resource,
|
||||
value=value,
|
||||
codec=self.codec,
|
||||
)
|
||||
key = command.run()
|
||||
if key.id is None:
|
||||
|
||||
@@ -43,6 +43,7 @@ class GetExplorePermalinkCommand(BaseExplorePermalinkCommand):
|
||||
value: Optional[ExplorePermalinkValue] = GetKeyValueCommand(
|
||||
resource=self.resource,
|
||||
key=key,
|
||||
codec=self.codec,
|
||||
).run()
|
||||
if value:
|
||||
chart_id: Optional[int] = value.get("chartId")
|
||||
|
||||
Reference in New Issue
Block a user