You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2021/06/29 21:21:21 UTC

[superset] 02/02: change reference for invalid port to 1031

This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch hugh/fix-port-err-num
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 88655a6d0ef0f9d15e3eb7c5cf9d4bce1ee86fdd
Author: hughhhh <hu...@gmail.com>
AuthorDate: Tue Jun 29 14:20:09 2021 -0700

    change reference for invalid port to 1031
---
 docs/src/pages/docs/Miscellaneous/issue_codes.mdx | 8 ++++++++
 superset/errors.py                                | 2 +-
 tests/databases/api_tests.py                      | 4 ++--
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/docs/src/pages/docs/Miscellaneous/issue_codes.mdx b/docs/src/pages/docs/Miscellaneous/issue_codes.mdx
index df8b65f..5a3b551 100644
--- a/docs/src/pages/docs/Miscellaneous/issue_codes.mdx
+++ b/docs/src/pages/docs/Miscellaneous/issue_codes.mdx
@@ -271,3 +271,11 @@ One or more parameters specified in the query are malformatted.
 ```
 
 The query contains one or more malformed template parameters. Please check your query and confirm that all template parameters are surround by double braces, for example, "{{ ds }}". Then, try running your query again.
+
+## Issue 1031
+
+```
+The database port provided is invalid.
+```
+
+Please check that the provided database port is an integer between 0 and 65535 (inclusive).
diff --git a/superset/errors.py b/superset/errors.py
index 52cee12..fd0cffe 100644
--- a/superset/errors.py
+++ b/superset/errors.py
@@ -188,7 +188,7 @@ ERROR_TYPES_TO_ISSUE_CODES_MAPPING = {
         {"code": 1008, "message": _("Issue 1008 - The port is closed.")},
     ],
     SupersetErrorType.CONNECTION_INVALID_PORT_ERROR: [
-        {"code": 1021, "message": _("Issue 1021 - Port number is invalid.")},
+        {"code": 1031, "message": _("Issue 1031 - Port number is invalid.")},
     ],
     SupersetErrorType.CONNECTION_HOST_DOWN_ERROR: [
         {
diff --git a/tests/databases/api_tests.py b/tests/databases/api_tests.py
index 9247a52..a61263a 100644
--- a/tests/databases/api_tests.py
+++ b/tests/databases/api_tests.py
@@ -1948,8 +1948,8 @@ class TestDatabaseApi(SupersetTestCase):
                         "invalid": ["port"],
                         "issue_codes": [
                             {
-                                "code": 1021,
-                                "message": "Issue 1021 - Port number is invalid.",
+                                "code": 1031,
+                                "message": "Issue 1031 - Port number is invalid.",
                             }
                         ],
                     },