[ https://issues.apache.org/jira/browse/BEAM-5745?focusedWorklogId=156583&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-156583 ]
ASF GitHub Bot logged work on BEAM-5745: ---------------------------------------- Author: ASF GitHub Bot Created on: 20/Oct/18 21:39 Start Date: 20/Oct/18 21:39 Worklog Time Spent: 10m Work Description: HuangLED commented on a change in pull request #6687: [BEAM-5745] Fix annotation test for py3 URL: https://github.com/apache/beam/pull/6687#discussion_r226840785 ########## File path: sdks/python/apache_beam/utils/annotations_test.py ########## @@ -32,9 +32,10 @@ def test_deprecated_with_since_current_message(self): @deprecated(since='v.1', current='multiply', extra_message='Do this') def fnc_test_deprecated_with_since_current_message(): return 'lol' + warnings.simplefilter("once") Review comment: This is only needed in python2. in python2, the whole list beings with a 'ignore' filtering rule. see a print out if we don't turn it on here: ``` BEGING [('ignore', <_sre.SRE_Pattern object at 0x7f3581e22b70>, <type 'exceptions.Warning'>, <_sre.SRE_Pattern object at 0x7f358192a510>, 0), ('ignore', <_sre.SRE_Pattern object at 0x7f3581154290>, <type 'exceptions.Warning'>, <_sre.SRE_Pattern object at 0x7f358192a510>, 0), ('ignore', <_sre.SRE_Pattern object at 0x7f3581154160>, <type 'exceptions.Warning'>, <_sre.SRE_Pattern object at 0x7f358192a510>, 0), ('always', None, <class 'numpy.lib.polynomial.RankWarning'>, None, 0), ... ... ``` this is also shown by the printout in the research you shared last time. Since our decision is to remove the once filtering rule in our module, it no longer matter which lib in the testing framework adds filtering rule. And I agree that is a good idea to leave the filtering strategy decision to the end user whoever using the library. This line just basically just turns the warning ON so that we can have something to validate in the test case. And alternatively we may use "always", or anything but 'ignore'. Essentially the same here. This line has nothing to do with frequency. In other words, the test case by default it has `ignore`, so we are making a fix here by turning the warning on, just to have some data to test with. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 156583) Time Spent: 3h (was: 2h 50m) > Util test on annotations fails > ------------------------------- > > Key: BEAM-5745 > URL: https://issues.apache.org/jira/browse/BEAM-5745 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core > Reporter: Ruoyun Huang > Assignee: Ruoyun Huang > Priority: Minor > Time Spent: 3h > Remaining Estimate: 0h > > Traceback (most recent call last): > File > "/usr/local/google/home/ruoyun/projects/beam/sdks/python/apache_beam/utils/annotations_test.py", > line 142, in test_frequency > label_check_list=[]) > File > "/usr/local/google/home/ruoyun/projects/beam/sdks/python/apache_beam/utils/annotations_test.py", > line 149, in check_annotation > self.assertIn(fnc_name + ' is ' + annotation_type, > str(warning[-1].message)) > AssertionError: 'fnc2_test_annotate_frequency is experimental' not found in > 'fnc_test_annotate_frequency is experimental.' -- This message was sent by Atlassian JIRA (v7.6.3#76005)