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

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

                Author: ASF GitHub Bot
            Created on: 12/Apr/22 21:48
            Start Date: 12/Apr/22 21:48
    Worklog Time Spent: 10m 
      Work Description: TheNeuralBit commented on code in PR #17351:
URL: https://github.com/apache/beam/pull/17351#discussion_r848899324


##########
sdks/python/apache_beam/runners/interactive/sql/utils_test.py:
##########
@@ -76,17 +76,23 @@ def test_replace_single_pcoll_token(self):
         replaced_sql, 'SELECT * FROM PCOLLECTION WHERE a=1 AND b=2')
 
   def test_pformat_namedtuple(self):
-    self.assertEqual(
-        'ANamedTuple(a: int, b: str)', pformat_namedtuple(ANamedTuple))
+    expected = pformat_namedtuple(ANamedTuple)
+    self.assertIn('ANamedTuple(', expected)
+    self.assertIn('a: int', expected)
+    self.assertIn('b: str', expected)
 
-  @unittest.skip("BEAM-14288")
   def test_pformat_namedtuple_with_unnamed_fields(self):
-    self.assertEqual(
-        f'OptionalUnionType(unnamed: {repr(Optional[Union[int, str]])})',
-        pformat_namedtuple(OptionalUnionType))
+    expected = pformat_namedtuple(OptionalUnionType)
+    self.assertIn('OptionalUnionType(unnamed: ', expected)
+    self.assertIn('Union', expected)
+    self.assertIn('int', expected)
+    self.assertIn('str', expected)
+    self.assertIn('NoneType', expected)

Review Comment:
   Using assertIn seems a little brittle (e.g. 
`Union[int,my_custom_string_type,float64,NoneType]` would pass as well), but 
I'm probably being nitpicky here.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 756050)
    Time Spent: 2h  (was: 1h 50m)

> Python PreCommit flaking in test_pformat_namedtuple_with_unnamed_fields
> -----------------------------------------------------------------------
>
>                 Key: BEAM-14288
>                 URL: https://issues.apache.org/jira/browse/BEAM-14288
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core, test-failures
>            Reporter: Brian Hulette
>            Assignee: Ning
>            Priority: P1
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> {code}
> self = <apache_beam.runners.interactive.sql.utils_test.UtilsTest 
> testMethod=test_pformat_namedtuple_with_unnamed_fields>
>     def test_pformat_namedtuple_with_unnamed_fields(self):
> >     self.assertEqual(
>           f'OptionalUnionType(unnamed: {repr(Optional[Union[int, str]])})',
>           pformat_namedtuple(OptionalUnionType))
> E     AssertionError: 'OptionalUnionType(unnamed: typing.Union[str, int, 
> NoneType])' != 'OptionalUnionType(unnamed: typing.Union[int, str, NoneType])'
> E     - OptionalUnionType(unnamed: typing.Union[str, int, NoneType])
> E     ?                                             -----
> E     + OptionalUnionType(unnamed: typing.Union[int, str, NoneType])
> E     ?                                         +++++
> apache_beam/runners/interactive/sql/utils_test.py:83: AssertionError
> {code}
> Hard to tell if this is a flake or a hard failure. If it's a hard failure, it 
> just started recently in cron run 
> https://ci-beam.apache.org/job/beam_PreCommit_Python_Cron/5498/
> In the runs I've seen since then the failure does seem consistent, but it 
> might only be affecting certain environments (py37-cloud, py39-cloud, 
> py38-cloudcoverage)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to