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: [email protected]

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


Reply via email to