[
https://issues.apache.org/jira/browse/BEAM-10549?focusedWorklogId=467101&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-467101
]
ASF GitHub Bot logged work on BEAM-10549:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 06/Aug/20 06:59
Start Date: 06/Aug/20 06:59
Worklog Time Spent: 10m
Work Description: saavannanavati commented on a change in pull request
#12352:
URL: https://github.com/apache/beam/pull/12352#discussion_r466145176
##########
File path: sdks/python/apache_beam/runners/common.py
##########
@@ -1340,6 +1342,17 @@ def process_outputs(
self.per_element_output_counter.add_input(0)
return
+ if isinstance(results, (dict, str, unicode, bytes)):
+ results_type = type(results).__name__
+ raise TypeCheckError(
+ 'Returning a %s from a ParDo or FlatMap is '
+ 'discouraged. Please use list("%s") if you really '
+ 'want this behavior.' % (results_type, results))
+ elif not isinstance(results, collections.Iterable):
Review comment:
Out of curiosity, why is this check slow? Also, if we remove it, how
should we give the user the relevant error message?
----------------------------------------------------------------
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: 467101)
Time Spent: 2h (was: 1h 50m)
> Improve Runtime Type Checking Performance
> -----------------------------------------
>
> Key: BEAM-10549
> URL: https://issues.apache.org/jira/browse/BEAM-10549
> Project: Beam
> Issue Type: Improvement
> Components: sdk-py-core
> Reporter: Saavan Nanavati
> Assignee: Saavan Nanavati
> Priority: P2
> Time Spent: 2h
> Remaining Estimate: 0h
>
> The performance gain will come from moving the runtime type check from a
> decorator to OperationCounters.
>
> This has (2) improvements:
> # Cython optimizable
> # Sampling is a built-in feature
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)