mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
chore(python-testing): move memoized tests to unit tests (#15507)
* chore: move memoized test into a separated file create integration test workflow * chore: create unit test workflow to run purely pytest * fix: bad reference * fix: remove pip requirements bc there aren't any yet * temp: install unit dependencies directly * fix: --rootdir= * fix: try to run only unit test * chore: decouple memoized as separated module * fix: bring back dependencies bc superset top-level module is coupled to flask and others so no reason no to do it * fix: reference * fix: pre-commit * fix: pylint
This commit is contained in:
@@ -23,7 +23,7 @@ from sqlalchemy import Column, Integer, String
|
||||
from superset import app, db, security_manager
|
||||
from superset.connectors.connector_registry import ConnectorRegistry
|
||||
from superset.models.helpers import AuditMixinNullable
|
||||
from superset.utils import core as utils
|
||||
from superset.utils.memoized import memoized
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from superset.connectors.base.models import BaseDatasource
|
||||
@@ -55,7 +55,7 @@ class DatasourceAccessRequest(Model, AuditMixinNullable):
|
||||
return self.get_datasource
|
||||
|
||||
@datasource.getter # type: ignore
|
||||
@utils.memoized
|
||||
@memoized
|
||||
def get_datasource(self) -> "BaseDatasource":
|
||||
ds = db.session.query(self.cls_model).filter_by(id=self.datasource_id).first()
|
||||
return ds
|
||||
|
||||
Reference in New Issue
Block a user