You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/10/13 18:56:28 UTC

[GitHub] [airflow] dstandish commented on pull request #18800: Make the salesforce connection initiation more robust

dstandish commented on pull request #18800:
URL: https://github.com/apache/airflow/pull/18800#issuecomment-942400344


   Yeah `.get(...) or None` seems like it would be fine from what I understand.
   
   Honestly, even though it is more code, I tend to prefer pruning the kwargs when possible and completely omitting the param when it's not meaningful  e.g.
   ```
   kwargs = ...
   kwargs = {k: v for k, v in kwargs.items() if v}
   something.connect(**kwargs)
   ```
   because sometimes client libraries will take a None as meaningful e.g. if the param had a string default, it would be replaced with None.
   
   the only risk in doing it _this_ way is if there was a _meaningful empty string_ that you genuinely wanted to have forwarded to the client :) 
   
   but i think that that tends to be pretty unlikely


-- 
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: commits-unsubscribe@airflow.apache.org

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