[
https://issues.apache.org/jira/browse/BEAM-11839?focusedWorklogId=585281&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-585281
]
ASF GitHub Bot logged work on BEAM-11839:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 19/Apr/21 17:46
Start Date: 19/Apr/21 17:46
Worklog Time Spent: 10m
Work Description: TheNeuralBit commented on a change in pull request
#14552:
URL: https://github.com/apache/beam/pull/14552#discussion_r616052715
##########
File path: sdks/python/apache_beam/dataframe/frames_test.py
##########
@@ -37,71 +37,109 @@
})
+def _get_deferred_args(*args):
+ return [
+ frame_base.DeferredFrame.wrap(
+ expressions.ConstantExpression(arg, arg[0:0])) for arg in args
+ ]
+
+
class DeferredFrameTest(unittest.TestCase):
- def _run_test(self, func, *args, distributed=True, expect_error=False):
- deferred_args = [
- frame_base.DeferredFrame.wrap(
- expressions.ConstantExpression(arg, arg[0:0])) for arg in args
- ]
+ def _run_error_test(self, func, *args):
+ """Verify that func(*args) raises the same exception in pandas and in Beam.
+
+ Note that for Beam this only checks for exceptions that are raised during
+ expression generation (i.e. construction time). Execution time exceptions
+ are not helpful."""
+ deferred_args = _get_deferred_args(*args)
+
+ # Get expected error
try:
- expected = func(*args)
+ _ = func(*args)
except Exception as e:
- if not expect_error:
- raise
expected = e
else:
- if expect_error:
- raise AssertionError(
- "Expected an error but computing expected result successfully "
- f"returned: {expected}")
+ raise AssertionError(
+ "Expected an error but computing expected result successfully "
+ f"returned: {expected}")
Review comment:
Ah yes thank you. I'll update this 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: 585281)
Time Spent: 3h (was: 2h 50m)
> Attach a "reason" message to Singleton partitioning
> ---------------------------------------------------
>
> Key: BEAM-11839
> URL: https://issues.apache.org/jira/browse/BEAM-11839
> Project: Beam
> Issue Type: Improvement
> Components: sdk-py-core
> Reporter: Brian Hulette
> Priority: P2
> Labels: dataframe-api
> Time Spent: 3h
> Remaining Estimate: 0h
>
> When Singleton partitioning is required, we should be able to attach a reason
> to it so we can raise a helpful message to the user later, e.g.
> {{partitionings.Singleton(reason="Only 'pearson' correlation can be computed
> in a distributed manner, other methods require Singleton partitioning")}}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)