fix: Fix migration for removing time_range_endpoints 3 (#19767)

* fix migration

* so dumb

* update test

* add code change

* retest
This commit is contained in:
Hugh A. Miles II
2022-04-19 09:49:50 -07:00
committed by GitHub
parent 4ba62cad95
commit 7e92340c70
3 changed files with 92 additions and 42 deletions

View File

@@ -16,7 +16,7 @@
# under the License.
import json
from superset.migrations.versions.cecc6bf46990_rm_time_range_endpoints_2 import (
from superset.migrations.versions.ad07e4fdbaba_rm_time_range_endpoints_from_qc_3 import (
Slice,
upgrade_slice,
)
@@ -106,7 +106,9 @@ sample_query_context = {
"post_processing": [],
}
],
"form_data": {},
"form_data": {
"time_range_endpoints": ["inclusive", "exclusive"],
},
"result_format": "json",
"result_type": "full",
}
@@ -123,6 +125,9 @@ def test_upgrade():
extras = q.get("extras", {})
assert "time_range_endpoints" not in extras
form_data = query_context.get("form_data", {})
assert "time_range_endpoints" not in form_data
def test_upgrade_bad_json():
slc = Slice(slice_name="FOO", query_context="abc")