Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning in Kokoro build log The 'warn' method is deprecated, use 'warning' instead #820

Closed
parthea opened this issue Dec 2, 2023 · 0 comments · Fixed by #821
Assignees
Labels
api: logging Issues related to the googleapis/python-logging API. type: cleanup An internal cleanup or hygiene concern.

Comments

@parthea
Copy link
Contributor

parthea commented Dec 2, 2023

The warning below appears in the Kokoro build log

>       cloud_logger.warn(LOG_MESSAGE, extra=extra)

tests/system/test_system.py:608: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = , msg = 'Testing with injected extras.'
args = ()
kwargs = {'extra': {'http_request': {'requestUrl': 'localhost'}, 'labels': {'test-label': 'manual'}, 'resource': Resource(type='cloudiot_device', labels={}), 'source_location': {'file': 'test.py'}, ...}}

    def warn(self, msg, *args, **kwargs):
>       warnings.warn("The 'warn' method is deprecated, "
            "use 'warning' instead", DeprecationWarning, 2)
E       DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead

/usr/local/lib/python3.8/logging/__init__.py:1461: DeprecationWarning
@parthea parthea added the type: cleanup An internal cleanup or hygiene concern. label Dec 2, 2023
@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/python-logging API. label Dec 2, 2023
parthea added a commit that referenced this issue Dec 2, 2023
gkevinzheng pushed a commit that referenced this issue Dec 4, 2023
* build: treat warnings as errors

* resolve warning Client.dataset is deprecated and will be removed in a future version

* See #820

* address warning @pytest.yield_fixture is deprecated. Use @pytest.fixture instead; they are the same.

* filter warnings from grpcio

* revert

* update comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/python-logging API. type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
3 participants