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

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

                Author: ASF GitHub Bot
            Created on: 11/Mar/21 21:57
            Start Date: 11/Mar/21 21:57
    Worklog Time Spent: 10m 
      Work Description: KevinGG commented on a change in pull request #14176:
URL: https://github.com/apache/beam/pull/14176#discussion_r592750637



##########
File path: sdks/python/apache_beam/runners/interactive/caching/cacheable.py
##########
@@ -0,0 +1,78 @@
+#
+# 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.
+#
+
+"""Module for dataclasses to hold metadata of cacheable PCollections in the 
user
+code scope.
+
+For internal use only; no backwards-compatibility guarantees.
+"""
+
+# pytype: skip-file
+
+from __future__ import absolute_import
+
+from dataclasses import dataclass
+
+import apache_beam as beam
+from apache_beam.runners.interactive.utils import obfuscate
+
+
+@dataclass
+class Cacheable:
+  pcoll_id: str
+  var: str
+  version: str
+  pcoll: beam.pvalue.PCollection
+  producer_version: str
+
+  def __hash__(self):
+    return hash((
+        self.pcoll_id,
+        self.var,
+        self.version,
+        self.pcoll,
+        self.producer_version))

Review comment:
       Thanks, the `pipeline_instrument` module still uses `Cacheable` as a 
mutable class. So we have to keep the explicit hash.




----------------------------------------------------------------
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: 564970)
    Time Spent: 9h 10m  (was: 9h)

> InteractiveRunner cannot execute pipeline with cross-language transform
> -----------------------------------------------------------------------
>
>                 Key: BEAM-10708
>                 URL: https://issues.apache.org/jira/browse/BEAM-10708
>             Project: Beam
>          Issue Type: Bug
>          Components: cross-language
>            Reporter: Brian Hulette
>            Assignee: Ning Kang
>            Priority: P2
>          Time Spent: 9h 10m
>  Remaining Estimate: 0h
>
> The InteractiveRunner crashes when given a pipeline that includes a 
> cross-language transform.
> Here's the example I tried to run in a jupyter notebook:
> {code:python}
> p = beam.Pipeline(InteractiveRunner())
> pc = (p | SqlTransform("""SELECT
>             CAST(1 AS INT) AS `id`,
>             CAST('foo' AS VARCHAR) AS `str`,
>             CAST(3.14  AS DOUBLE) AS `flt`"""))
> df = interactive_beam.collect(pc)
> {code}
> The problem occurs when 
> [pipeline_fragment.py|https://github.com/apache/beam/blob/dce1eb83b8d5137c56ac58568820c24bd8fda526/sdks/python/apache_beam/runners/interactive/pipeline_fragment.py#L66]
>  creates a copy of the pipeline by [writing it to proto and reading it 
> back|https://github.com/apache/beam/blob/dce1eb83b8d5137c56ac58568820c24bd8fda526/sdks/python/apache_beam/runners/interactive/pipeline_fragment.py#L120].
>  Reading it back fails because some of the pipeline is not written in Python.



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

Reply via email to