[
https://issues.apache.org/jira/browse/BEAM-5932?focusedWorklogId=161735&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-161735
]
ASF GitHub Bot logged work on BEAM-5932:
----------------------------------------
Author: ASF GitHub Bot
Created on: 01/Nov/18 20:43
Start Date: 01/Nov/18 20:43
Worklog Time Spent: 10m
Work Description: tvalentyn commented on a change in pull request #6907:
[BEAM-5932] Re-enable Beam SDK deprecation warnings.
URL: https://github.com/apache/beam/pull/6907#discussion_r230191037
##########
File path: sdks/python/apache_beam/utils/annotations.py
##########
@@ -88,6 +88,14 @@ def exp_multiply(arg1, arg2):
from functools import wraps
+class BeamDeprecationWarning(DeprecationWarning):
+ """Beam-specific deprecation warnings."""
+
+
+# Don't ignore BeamDeprecationWarnings.
+warnings.simplefilter('once', BeamDeprecationWarning)
Review comment:
It shows only first occurrence of a matching warning. So if a function is
decorated as deprecated, and called twice, we produce warning only once. If
another function is also decorated as deprecated, we will still produce the
first warning.
We used to have a test that verified this behavior albeit for experimental
warnings:
https://github.com/apache/beam/pull/6687/files#diff-ad168c748517e6a41781bd795008b4b5L127.
The test didn't work on Python 3 because test framework on Python 3 calls
`warnings.simplefilter('default', BeamDeprecationWarning)` at some point. We
can revive the test and add `warnings.simplefilter('once',
BeamDeprecationWarning)` to the test code make it work on Py3.
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 161735)
Time Spent: 50m (was: 40m)
> Python SDK deprecation warnings are broken
> ------------------------------------------
>
> Key: BEAM-5932
> URL: https://issues.apache.org/jira/browse/BEAM-5932
> Project: Beam
> Issue Type: Bug
> Components: sdk-py-core
> Reporter: Udi Meiri
> Assignee: Udi Meiri
> Priority: Blocker
> Time Spent: 50m
> Remaining Estimate: 0h
>
> [https://github.com/apache/beam/pull/6687]
> removed the line
> {code:python}
> warnings.simplefilter("once"){code}
> from annotations.py.
> This disables all deprecation warnings.
> Please fix.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)