You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/11/18 07:10:25 UTC

[GitHub] [superset] villebro commented on a change in pull request #17470: fix(presto): expand data with null item

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