mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix: Make sheet_name into a ValidationInputError (#16056)
* setup validates for name * add error type * fix linting * fix test * remove errors * fix number * fix test
This commit is contained in:
@@ -40,24 +40,7 @@ def test_validate_parameters_simple(
|
||||
"catalog": {},
|
||||
}
|
||||
errors = GSheetsEngineSpec.validate_parameters(parameters)
|
||||
assert errors == [
|
||||
SupersetError(
|
||||
message="URL is required",
|
||||
error_type=SupersetErrorType.CONNECTION_MISSING_PARAMETERS_ERROR,
|
||||
level=ErrorLevel.WARNING,
|
||||
extra={
|
||||
"invalid": ["catalog"],
|
||||
"name": "",
|
||||
"url": "",
|
||||
"issue_codes": [
|
||||
{
|
||||
"code": 1018,
|
||||
"message": "Issue 1018 - One or more parameters needed to configure a database are missing.",
|
||||
}
|
||||
],
|
||||
},
|
||||
)
|
||||
]
|
||||
assert errors == []
|
||||
|
||||
|
||||
def test_validate_parameters_catalog(
|
||||
@@ -96,9 +79,7 @@ def test_validate_parameters_catalog(
|
||||
error_type=SupersetErrorType.TABLE_DOES_NOT_EXIST_ERROR,
|
||||
level=ErrorLevel.WARNING,
|
||||
extra={
|
||||
"invalid": ["catalog"],
|
||||
"name": "private_sheet",
|
||||
"url": "https://docs.google.com/spreadsheets/d/1/edit",
|
||||
"catalog": {"idx": 0, "url": True,},
|
||||
"issue_codes": [
|
||||
{
|
||||
"code": 1003,
|
||||
@@ -116,9 +97,7 @@ def test_validate_parameters_catalog(
|
||||
error_type=SupersetErrorType.TABLE_DOES_NOT_EXIST_ERROR,
|
||||
level=ErrorLevel.WARNING,
|
||||
extra={
|
||||
"invalid": ["catalog"],
|
||||
"name": "not_a_sheet",
|
||||
"url": "https://www.google.com/",
|
||||
"catalog": {"idx": 2, "url": True,},
|
||||
"issue_codes": [
|
||||
{
|
||||
"code": 1003,
|
||||
@@ -173,9 +152,7 @@ def test_validate_parameters_catalog_and_credentials(
|
||||
error_type=SupersetErrorType.TABLE_DOES_NOT_EXIST_ERROR,
|
||||
level=ErrorLevel.WARNING,
|
||||
extra={
|
||||
"invalid": ["catalog"],
|
||||
"name": "not_a_sheet",
|
||||
"url": "https://www.google.com/",
|
||||
"catalog": {"idx": 2, "url": True,},
|
||||
"issue_codes": [
|
||||
{
|
||||
"code": 1003,
|
||||
|
||||
Reference in New Issue
Block a user