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

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

                Author: ASF GitHub Bot
            Created on: 29/May/19 00:36
            Start Date: 29/May/19 00:36
    Worklog Time Spent: 10m 
      Work Description: ostrokach commented on pull request #8687: [BEAM-6356] 
Add the option to use TFRecord to store cache results using PCollection's PCoder
URL: https://github.com/apache/beam/pull/8687#discussion_r288354285
 
 

 ##########
 File path: sdks/python/apache_beam/runners/interactive/cache_manager.py
 ##########
 @@ -107,6 +127,13 @@ def __init__(self, cache_dir=None):
       self._cache_dir = tempfile.mkdtemp(
           prefix='interactive-temp-', dir=os.environ.get('TEST_TMPDIR', None))
     self._versions = collections.defaultdict(lambda: self._CacheVersion())
+
+    if cache_format not in self._available_formats:
+      raise ValueError("Unsupported cache format: '%s'." % cache_format)
+    self._Reader, self._Writer = self._available_formats[cache_format]
 
 Review comment:
   Yes, I agree. I just wanted to indicate that those variables refer to class 
objects rather than functions, and to distinguish them from 
`iobase.NativeSource.reader`, `iobase.NativeSink.writer`, etc.
   
   I renamed the variables as `self._reader_class` and `self._writer_class`, 
which should follow the naming convention but also let the user know that those 
are not functions?
 
----------------------------------------------------------------
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: 249742)
            Time Spent: 1h 20m  (was: 1h 10m)
    Remaining Estimate: 166h 40m  (was: 166h 50m)

> Python  FileBasedCacheManager does not respect PCoder for PCollection being 
> cached
> ----------------------------------------------------------------------------------
>
>                 Key: BEAM-6356
>                 URL: https://issues.apache.org/jira/browse/BEAM-6356
>             Project: Beam
>          Issue Type: Improvement
>          Components: examples-python
>            Reporter: Hennadiy Leontyev
>            Assignee: Qinye Li
>            Priority: Minor
>   Original Estimate: 168h
>          Time Spent: 1h 20m
>  Remaining Estimate: 166h 40m
>
> FileBasedCacheManager used by Python's InteractiveRunner does not preserve 
> PCoder for elements of a PCollection being cached on disk. I suggest that the 
> cache on-disk format to be changed to TFRecords (which are supported by Beam) 
> and FileBasedCacheManager would store the desired PCoder for cached 
> collections.
> Currently, it is not possible to work with dynamically-generated protocol 
> buffer messages in interactive runner mode because of pickling errors.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to