[
https://issues.apache.org/jira/browse/BEAM-8335?focusedWorklogId=390163&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-390163
]
ASF GitHub Bot logged work on BEAM-8335:
----------------------------------------
Author: ASF GitHub Bot
Created on: 20/Feb/20 18:40
Start Date: 20/Feb/20 18:40
Worklog Time Spent: 10m
Work Description: rohdesamuel commented on pull request #10915:
[BEAM-8335] Add PCollection to DataFrame logic for InteractiveRunner.
URL: https://github.com/apache/beam/pull/10915#discussion_r382185263
##########
File path: sdks/python/apache_beam/runners/interactive/utils_test.py
##########
@@ -0,0 +1,138 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+from __future__ import absolute_import
+
+import unittest
+
+import pandas as pd
+
+from apache_beam.runners.interactive import utils
+from apache_beam.typehints.typehints import Any
+from apache_beam.typehints.typehints import Dict
+from apache_beam.typehints.typehints import List
+from apache_beam.typehints.typehints import Tuple
+from apache_beam.utils.windowed_value import WindowedValue
+
+
+class ParseToDataframeTest(unittest.TestCase):
+ def test_parse_1(self):
+ el = (1, 'a')
+ element_type = Tuple[int, str]
+
+ columns, elements = utils.parse_row(el, element_type)
+ self.assertEqual(columns, ['el[0]', 'el[1]'])
+ self.assertEqual(elements, [1, 'a'])
+
+ def test_parse_2(self):
+ el = ((1, 2.0, 'a'), 'b')
+ element_type = Tuple[Tuple[int, float, str], str]
+
+ columns, elements = utils.parse_row(el, element_type)
+ self.assertEqual(columns, ['el[0][0]', 'el[0][1]', 'el[0][2]', 'el[1]'])
+ self.assertEqual(elements, [1, 2.0, 'a', 'b'])
+
+ def test_parse_3(self):
+ el = [1, 2, 3]
+ element_type = List[int]
+
+ columns, elements = utils.parse_row(el, element_type)
+ self.assertEqual(columns, ['el'])
+ self.assertEqual(elements, [[1, 2, 3]])
+
+ def test_parse_4(self):
+ el = ('k', [1, 2, 3])
+ element_type = Tuple[str, List[int]]
+
+ columns, elements = utils.parse_row(el, element_type)
+ self.assertEqual(columns, ['el[0]', 'el[1]'])
+ self.assertEqual(elements, ['k', [1, 2, 3]])
+
+ def test_parse_5(self):
+ el = (([1, 2, 3], {'b': 1, 'c': 2}), 'a')
+ element_type = Tuple[Tuple[List[int], Dict[str, int]], str]
+
+ columns, elements = utils.parse_row(el, element_type)
+ self.assertEqual(columns, ['el[0][0]', 'el[0][1]', 'el[1]'])
+ self.assertEqual(elements, [[1, 2, 3], {'b': 1, 'c': 2}, 'a'])
+
+ def test_parse_5(self):
Review comment:
Done
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 390163)
Time Spent: 67.5h (was: 67h 20m)
> Add streaming support to Interactive Beam
> -----------------------------------------
>
> Key: BEAM-8335
> URL: https://issues.apache.org/jira/browse/BEAM-8335
> Project: Beam
> Issue Type: Improvement
> Components: runner-py-interactive
> Reporter: Sam Rohde
> Assignee: Sam Rohde
> Priority: Major
> Time Spent: 67.5h
> Remaining Estimate: 0h
>
> This issue tracks the work items to introduce streaming support to the
> Interactive Beam experience. This will allow users to:
> * Write and run a streaming job in IPython
> * Automatically cache records from unbounded sources
> * Add a replay experience that replays all cached records to simulate the
> original pipeline execution
> * Add controls to play/pause/stop/step individual elements from the cached
> records
> * Add ability to inspect/visualize unbounded PCollections
--
This message was sent by Atlassian Jira
(v8.3.4#803005)