You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "AAfghahi (via GitHub)" <gi...@apache.org> on 2023/01/31 16:20:52 UTC

[GitHub] [superset] AAfghahi commented on a diff in pull request #22912: fix: fix warning in ssh tunnel

AAfghahi commented on code in PR #22912:
URL: https://github.com/apache/superset/pull/22912#discussion_r1092169089


##########
superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx:
##########
@@ -374,21 +375,21 @@ export function dbReducer(
       };
     case ActionType.setSSHTunnelLoginMethod:
       if (action.payload.login_method === AuthType.privateKey) {
-        const { password, ...rest } = trimmedState?.ssh_tunnel ?? {};
         return {
           ...trimmedState,
           ssh_tunnel: {
-            ...rest,
+            ...omit(trimmedState?.ssh_tunnel, ['password']),

Review Comment:
   Eric's method of making sure that there is no issue around null and undefined makes me a bit more comfortable, personally. 
   
   Instead of omitting, could we use a `pick` here instead? @Antonio-RiveroMartnez is there a place where we define what columns the object should have? Are they the same btwn the two login methods?



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org