graceguo-supercat edited a comment on issue #9311: [cache warm_up] warm_up 
slice with dashboard default_filters
URL: 
https://github.com/apache/incubator-superset/pull/9311#issuecomment-600319778
 
 
   > The main difference here applies if it's possible for a key to be set to a 
falsey value. If you have the dict:
   > 
   > ```python
   > d = {
   >   "key": None,
   >   "foo": False,
   > }
   > ```
   > 
   > then:
   > 
   > ```python
   > d.get("key", []) # equals None
   > d.get("foo", {}) # equals False
   > d.get("key") or [] # equals []
   > d.get("foo") or {} # equals {}
   > ```
   > 
   > This is really important to get right if you try to iterate through an 
array after "getting" it like this, as iterating over False or None will throw
   
   Correct. If the key exists,  I should use falsy value, instead of assign a 
default value. See my example above.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to