mirror of https://github.com/apache/superset.git
fix: always create parameter json field (#19899)
* fix: always create parameter json field * ensure validation for empty catalog * check engine instead of name * put validation in be * fix test * fix test * remove test
This commit is contained in:
parent
73443cea2f
commit
0501ad25e8
|
@ -171,6 +171,14 @@ class GSheetsEngineSpec(SqliteEngineSpec):
|
||||||
|
|
||||||
if not table_catalog:
|
if not table_catalog:
|
||||||
# Allowing users to submit empty catalogs
|
# Allowing users to submit empty catalogs
|
||||||
|
errors.append(
|
||||||
|
SupersetError(
|
||||||
|
message="Sheet name is required",
|
||||||
|
error_type=SupersetErrorType.CONNECTION_MISSING_PARAMETERS_ERROR,
|
||||||
|
level=ErrorLevel.WARNING,
|
||||||
|
extra={"catalog": {"idx": 0, "name": True}},
|
||||||
|
),
|
||||||
|
)
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
# We need a subject in case domain wide delegation is set, otherwise the
|
# We need a subject in case domain wide delegation is set, otherwise the
|
||||||
|
|
|
@ -40,7 +40,14 @@ def test_validate_parameters_simple(
|
||||||
"catalog": {},
|
"catalog": {},
|
||||||
}
|
}
|
||||||
errors = GSheetsEngineSpec.validate_parameters(parameters)
|
errors = GSheetsEngineSpec.validate_parameters(parameters)
|
||||||
assert errors == []
|
assert errors == [
|
||||||
|
SupersetError(
|
||||||
|
message="Sheet name is required",
|
||||||
|
error_type=SupersetErrorType.CONNECTION_MISSING_PARAMETERS_ERROR,
|
||||||
|
level=ErrorLevel.WARNING,
|
||||||
|
extra={"catalog": {"idx": 0, "name": True}},
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def test_validate_parameters_catalog(
|
def test_validate_parameters_catalog(
|
||||||
|
|
Loading…
Reference in New Issue