This is an automated email from the ASF dual-hosted git repository. beto pushed a commit to branch set_examples_db_uuid in repository https://gitbox.apache.org/repos/asf/superset.git
commit 1b980a538697c885a8491b6e2c15c11a9079d1d5 Author: Beto Dealmeida <[email protected]> AuthorDate: Thu Jul 15 14:41:16 2021 -0700 chore: set UUID of examples DB --- superset/constants.py | 4 ++++ .../configs/datasets/examples/users_channels-uzooNNtSRO.yaml | 2 +- superset/utils/core.py | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/superset/constants.py b/superset/constants.py index a4f0ad1..7defc34 100644 --- a/superset/constants.py +++ b/superset/constants.py @@ -21,6 +21,10 @@ NULL_STRING = "<NULL>" +# UUID for the examples database +EXAMPLES_DB_UUID = "a2dc77af-e654-49bb-b321-40f6b559a1ee" + + class RouteMethod: # pylint: disable=too-few-public-methods """ Route methods are a FAB concept around ModelView and RestModelView diff --git a/superset/examples/configs/datasets/examples/users_channels-uzooNNtSRO.yaml b/superset/examples/configs/datasets/examples/users_channels-uzooNNtSRO.yaml index f54d061..152ca32 100644 --- a/superset/examples/configs/datasets/examples/users_channels-uzooNNtSRO.yaml +++ b/superset/examples/configs/datasets/examples/users_channels-uzooNNtSRO.yaml @@ -73,4 +73,4 @@ columns: description: null python_date_format: null version: 1.0.0 -database_uuid: 566ca280-3da8-967e-4aa4-4b349218736a +database_uuid: a2dc77af-e654-49bb-b321-40f6b559a1ee diff --git a/superset/utils/core.py b/superset/utils/core.py index 936e191..086133e 100644 --- a/superset/utils/core.py +++ b/superset/utils/core.py @@ -85,6 +85,7 @@ from typing_extensions import TypedDict import _thread # pylint: disable=C0411 from superset.constants import ( + EXAMPLES_DB_UUID, EXTRA_FORM_DATA_APPEND_KEYS, EXTRA_FORM_DATA_OVERRIDE_EXTRA_KEYS, EXTRA_FORM_DATA_OVERRIDE_REGULAR_MAPPINGS, @@ -1169,7 +1170,7 @@ def get_or_create_db( if not database and always_create: logger.info("Creating database reference for %s", database_name) - database = models.Database(database_name=database_name) + database = models.Database(database_name=database_name, uuid=EXAMPLES_DB_UUID) db.session.add(database) if database: @@ -1511,7 +1512,8 @@ def is_test() -> bool: def get_time_filter_status( # pylint: disable=too-many-branches - datasource: "BaseDatasource", applied_time_extras: Dict[str, str], + datasource: "BaseDatasource", + applied_time_extras: Dict[str, str], ) -> Tuple[List[Dict[str, str]], List[Dict[str, str]]]: temporal_columns = {col.column_name for col in datasource.columns if col.is_dttm} applied: List[Dict[str, str]] = []
