From d3d3565592c9977f1adaf1812e484d7ce4d04853 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Mon, 24 Jun 2024 17:39:44 +0300 Subject: [PATCH] remove redundant dataclass --- superset/commands/dashboard/permalink/create.py | 2 +- superset/key_value/types.py | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/superset/commands/dashboard/permalink/create.py b/superset/commands/dashboard/permalink/create.py index 17708d0f41..a1acb59043 100644 --- a/superset/commands/dashboard/permalink/create.py +++ b/superset/commands/dashboard/permalink/create.py @@ -58,9 +58,9 @@ class CreateDashboardPermalinkCommand(BaseDashboardPermalinkCommand): user_id = get_user_id() entry = KeyValueDAO.upsert_entry( resource=self.resource, + key=get_deterministic_uuid(self.salt, (user_id, value)), value=value, codec=self.codec, - key=get_deterministic_uuid(self.salt, (user_id, value)), ) db.session.flush() assert entry.id # for type checks diff --git a/superset/key_value/types.py b/superset/key_value/types.py index 7b0130c0e6..387c580d24 100644 --- a/superset/key_value/types.py +++ b/superset/key_value/types.py @@ -19,7 +19,6 @@ from __future__ import annotations import json import pickle from abc import ABC, abstractmethod -from dataclasses import dataclass from typing import Any, TypedDict from uuid import UUID @@ -32,12 +31,6 @@ from superset.key_value.exceptions import ( from superset.utils.backports import StrEnum -@dataclass -class Key: - id: int | None - uuid: UUID | None - - class KeyValueFilter(TypedDict, total=False): resource: str id: int | None