[
https://issues.apache.org/jira/browse/BEAM-6778?focusedWorklogId=213137&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-213137
]
ASF GitHub Bot logged work on BEAM-6778:
----------------------------------------
Author: ASF GitHub Bot
Created on: 14/Mar/19 14:23
Start Date: 14/Mar/19 14:23
Worklog Time Spent: 10m
Work Description: robertwb commented on pull request #7937: [BEAM-6778]
Enable Bundle Finalization in Python SDK harness over FnApi
URL: https://github.com/apache/beam/pull/7937#discussion_r265576939
##########
File path: sdks/python/apache_beam/runners/portability/fn_api_runner_test.py
##########
@@ -753,6 +753,81 @@ def create_pipeline(self):
runner=fn_api_runner.FnApiRunner(bundle_repeat=3))
+class EventRecorder(object):
+ def __init__(self):
+ self.work_path = os.getcwd() + '/EventRecorder'
+ if os.path.exists(self.work_path):
+ self.cleanup()
+ os.mkdir(self.work_path)
+
+ def record(self, file_name):
+ file_path = os.path.join(self.work_path, str(file_name) + '.txt')
Review comment:
We won't be able to tell if the same event was recorded twice (which could
be important, e.g. finalizers are called at most once). It would also be bad if
file_name had .. or other characters in it.
Instead, create a new temporary file in this directory and write the
argument as its contents.
https://docs.python.org/2/library/tempfile.html
----------------------------------------------------------------
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: 213137)
Time Spent: 1h 40m (was: 1.5h)
> Enable Bundle Finalization in Python SDK
> ----------------------------------------
>
> Key: BEAM-6778
> URL: https://issues.apache.org/jira/browse/BEAM-6778
> Project: Beam
> Issue Type: New Feature
> Components: sdk-py-harness
> Reporter: Boyuan Zhang
> Assignee: Boyuan Zhang
> Priority: Major
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)