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

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

                Author: ASF GitHub Bot
            Created on: 05/Nov/20 01:38
            Start Date: 05/Nov/20 01:38
    Worklog Time Spent: 10m 
      Work Description: tvalentyn commented on a change in pull request #13048:
URL: https://github.com/apache/beam/pull/13048#discussion_r517731074



##########
File path: sdks/python/apache_beam/transforms/combiners.py
##########
@@ -700,6 +700,9 @@ def __init__(self, n):
     # helper instead.
     self._top_combiner = TopCombineFn(n)
 
+  def setup(self):
+    self._top_combiner.setup()

Review comment:
       I think this would fail the Dataflow V1 check as well.
   I thought of possible improvement of the check [`bad0a52` 
(#13267)](https://github.com/apache/beam/pull/13267/commits/bad0a522ced25cc6ceef3ad14563ed2f6419788f)
 and this call would cause an issue.
   
   




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

> Add SetUp() and TearDown() for CombineFns
> -----------------------------------------
>
>                 Key: BEAM-3736
>                 URL: https://issues.apache.org/jira/browse/BEAM-3736
>             Project: Beam
>          Issue Type: Improvement
>          Components: beam-model, sdk-py-core
>            Reporter: Chuan Yu Foo
>            Assignee: Kamil Wasilewski
>            Priority: P0
>             Fix For: 2.26.0
>
>          Time Spent: 12h 10m
>  Remaining Estimate: 0h
>
> I have a CombineFn that has a large amount of state that needs to be loaded 
> once before it can add_input or merge_combiners (for example, the CombineFn 
> might load up a large lookup table used for combining). 
> Right now, to initialise this state, for each of the methods, I check if the 
> state has already been initialised, and if not, I initialise it. It would be 
> nice if CombineFn provided a SetUp() method that is called once to initialise 
> this state (and a corresponding TearDown() method to clean up this state if 
> necessary).



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

Reply via email to