[ 
https://issues.apache.org/jira/browse/BEAM-7923?focusedWorklogId=404913&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-404913
 ]

ASF GitHub Bot logged work on BEAM-7923:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Mar/20 19:36
            Start Date: 17/Mar/20 19:36
    Worklog Time Spent: 10m 
      Work Description: KevinGG commented on pull request #11147: [BEAM-7923] 
Support dict and iterable PCollections in show
URL: https://github.com/apache/beam/pull/11147#discussion_r393922585
 
 

 ##########
 File path: sdks/python/apache_beam/runners/interactive/interactive_beam.py
 ##########
 @@ -276,6 +284,21 @@ def show(*pcolls, **configs):
       # PCollection `square` and PCollection `cube`, then visualizes them.
       show(square, cube)
   """
+  flatten_pcolls = []
+  for pcoll_container in pcolls:
+    if isinstance(pcoll_container, dict):
+      flatten_pcolls.extend(pcoll_container.values())
+    elif isinstance(pcoll_container, beam.pvalue.PCollection):
+      flatten_pcolls.append(pcoll_container)
+    else:
+      try:
+        flatten_pcolls.extend(iter(pcoll_container))
+      except TypeError:
+        _LOGGER.warning(
+            'The given pcoll %s is not a dict, an iterable or a PCollection.',
+            pcoll_container)
+        return
 
 Review comment:
   Yes, we could raise a ValueError. Changing it!
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 404913)
    Time Spent: 3h  (was: 2h 50m)

> Interactive Beam
> ----------------
>
>                 Key: BEAM-7923
>                 URL: https://issues.apache.org/jira/browse/BEAM-7923
>             Project: Beam
>          Issue Type: New Feature
>          Components: runner-py-interactive
>            Reporter: Ning Kang
>            Assignee: Ning Kang
>            Priority: Major
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> This is the top level ticket for all efforts leveraging [interactive 
> Beam|[https://github.com/apache/beam/tree/master/sdks/python/apache_beam/runners/interactive]]
> As the development goes, blocking tickets will be added to this one.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to