fix(metastore-cache): import dao in methods (#29451)

This commit is contained in:
Ville Brofeldt
2024-07-02 15:28:42 +03:00
committed by GitHub
parent 7bb7fc0f49
commit 7f3c8efab0
2 changed files with 14 additions and 7 deletions

View File

@@ -18,13 +18,14 @@ from __future__ import annotations
from contextlib import nullcontext
from datetime import datetime, timedelta
from typing import Any, TYPE_CHECKING
from typing import Any
from uuid import UUID
import pytest
from flask.ctx import AppContext
from freezegun import freeze_time
from superset.extensions.metastore_cache import SupersetMetastoreCache
from superset.key_value.exceptions import KeyValueCodecEncodeException
from superset.key_value.types import (
JsonKeyValueCodec,
@@ -32,9 +33,6 @@ from superset.key_value.types import (
PickleKeyValueCodec,
)
if TYPE_CHECKING:
from superset.extensions.metastore_cache import SupersetMetastoreCache
NAMESPACE = UUID("ee173d1b-ccf3-40aa-941c-985c15224496")
FIRST_KEY = "foo"
@@ -47,8 +45,6 @@ SECOND_VALUE = "qwerty"
@pytest.fixture
def cache() -> SupersetMetastoreCache:
from superset.extensions.metastore_cache import SupersetMetastoreCache
return SupersetMetastoreCache(
namespace=NAMESPACE,
default_timeout=600,