fix: Ensure table uniqueness on update (#15909)

* fix: Ensure table uniqueness on update

* Update models.py

* Update slice.py

* Update datasource_tests.py

Co-authored-by: John Bodley <john.bodley@airbnb.com>
This commit is contained in:
John Bodley
2021-08-02 12:45:55 -07:00
committed by GitHub
parent 76a13dfc9a
commit c0615c55df
20 changed files with 344 additions and 274 deletions

View File

@@ -18,7 +18,7 @@ import copy
from typing import Any, Dict, List
from superset.utils.core import AnnotationType, DTTM_ALIAS, TimeRangeEndpoint
from tests.integration_tests.base_tests import get_table_by_name
from tests.integration_tests.base_tests import SupersetTestCase
query_birth_names = {
"extras": {
@@ -245,7 +245,7 @@ def get_query_context(
:return: Request payload
"""
table_name = query_name.split(":")[0]
table = get_table_by_name(table_name)
table = SupersetTestCase.get_table(name=table_name)
return {
"datasource": {"id": table.id, "type": table.type},
"queries": [