From 88724a822cd6749142364bb69d0b233273f941ae Mon Sep 17 00:00:00 2001 From: yonipeleg33 <51454184+yonipeleg33@users.noreply.github.com> Date: Thu, 11 Jul 2024 22:36:29 +0300 Subject: [PATCH] fix: show deprecation warnings from the Python wrapper by default (#7986) --- clients/python-wrapper/lakefs/branch.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clients/python-wrapper/lakefs/branch.py b/clients/python-wrapper/lakefs/branch.py index f4df0bd8363..280901870a1 100644 --- a/clients/python-wrapper/lakefs/branch.py +++ b/clients/python-wrapper/lakefs/branch.py @@ -4,6 +4,7 @@ from __future__ import annotations +import sys import uuid import warnings from contextlib import contextmanager @@ -23,6 +24,9 @@ TransactionException ) +# Unless stated otherwise by passing `-W ` to Python, we display `DeprecationWarning`s by default. +if not sys.warnoptions: + warnings.simplefilter('always', DeprecationWarning) class _BaseBranch(Reference):