villebro commented on a change in pull request #17470:
URL: https://github.com/apache/superset/pull/17470#discussion_r751957706



##########
File path: superset/db_engine_specs/presto.py
##########
@@ -872,7 +872,7 @@ def expand_data(  # pylint: disable=too-many-locals
                     values = row.get(name) or []
                     if isinstance(values, str):
                         row[name] = values = cast(List[Any], 
destringify(values))
-                    for value, col in zip(values, expanded):
+                    for value, col in zip(values or [], expanded):

Review comment:
       As the destringified values may be `None`, we should probably also 
update line 874 to reflect this by updating the cast to more accurately reflect 
the expected return value:
   ```python
   row[name] = values = cast(Optional[List[Any]], destringify(values))
   ```
   With this change mypy would see that `values` may be `None`. Alternatively 
we may want to move the `or []` up one line, but in this case the return value 
will change (not sure which is better).




-- 
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