msyavuz commented on code in PR #36880:
URL: https://github.com/apache/superset/pull/36880#discussion_r2821677100


##########
superset/commands/database/validate.py:
##########
@@ -65,8 +72,17 @@ def run(self) -> None:
                 ),
             )
 
-        # perform initial validation
+        # perform initial validation (host, port, database, username)
         errors = engine_spec.validate_parameters(self._properties)  # type: 
ignore
+
+        # Collect database_name errors along with parameter errors
+        if database_name_error := self._get_database_name_error():
+            errors.append(database_name_error)
+
+        # Collect SSH tunnel errors
+        ssh_tunnel_errors = self._get_ssh_tunnel_errors()
+        errors.extend(ssh_tunnel_errors)
+

Review Comment:
   Can we check the top line here includes the other ones? I think we must've 
been doing db name errors at least.



##########
superset/static/service-worker.js:
##########


Review Comment:
   I think this was committed by mistake



##########
superset-frontend/src/views/CRUD/hooks.ts:
##########
@@ -809,6 +802,19 @@ export function useDatabaseValidation() {
                   return acc;
                 }
 
+                // Handle SSH tunnel errors
+                if (extra?.ssh_tunnel) {
+                  if (!acc.ssh_tunnel) {
+                    acc.ssh_tunnel = {};
+                  }
+                  if (extra?.missing) {
+                    extra.missing.forEach((field: string) => {
+                      acc.ssh_tunnel[field] = 'This is a required field';
+                    });
+                  }
+                  return acc;
+                }

Review Comment:
   We can probably shorten this somewhat



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to