From c4b223f6fb32d836c2e2c0cb4fb590e977c596ee Mon Sep 17 00:00:00 2001 From: Artsiom Tserashkovich Date: Thu, 12 Oct 2023 12:10:53 +0200 Subject: [PATCH 1/7] Made ensure_disk_not_full more reliable for env specific errors --- CHANGELOG.md | 1 + src/neptune/internal/utils/disk_full.py | 62 +++++++++++-------- .../new/internal/utils/test_full_disk.py | 50 +++++++++++++++ 3 files changed, 88 insertions(+), 25 deletions(-) create mode 100644 tests/unit/neptune/new/internal/utils/test_full_disk.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 937de9920..18dcf8efd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Safety (errors suppressing) execution mode ([#1503](https://github.com/neptune-ai/neptune-client/pull/1503)) - Allow to disable handling of remote signals ([#1508](https://github.com/neptune-ai/neptune-client/pull/1508)) - Allow to disable deletion of local parent folder ([#1511](https://github.com/neptune-ai/neptune-client/pull/1511)) +- Made the disk checking more reliable for env specific errors ([]()) ### Fixes - Added more safe checking to last ack ([#1510](https://github.com/neptune-ai/neptune-client/pull/1510)) diff --git a/src/neptune/internal/utils/disk_full.py b/src/neptune/internal/utils/disk_full.py index f56918759..0df2c3fd7 100644 --- a/src/neptune/internal/utils/disk_full.py +++ b/src/neptune/internal/utils/disk_full.py @@ -27,6 +27,7 @@ ) import psutil +from psutil import Error from neptune.common.warnings import ( NeptuneWarning, @@ -60,28 +61,39 @@ def get_max_percentage_from_env() -> Optional[float]: return None -def ensure_disk_not_full(func: Callable[..., None]) -> Callable[..., None]: - non_raising_on_disk_issue = NEPTUNE_NON_RAISING_ON_DISK_ISSUE in os.environ - max_disk_utilization = get_max_percentage_from_env() - - @wraps(func) - def wrapper(*args: Tuple, **kwargs: Dict[str, Any]) -> None: - if non_raising_on_disk_issue: - try: - if max_disk_utilization: - current_utilization = get_disk_utilization_percent() - if current_utilization > max_disk_utilization: - warn_once( - f"Max disk utilization {max_disk_utilization}% exceeded with {current_utilization}." - f" Neptune will not be saving your data.", - exception=NeptuneWarning, - ) - return - - func(*args, **kwargs) - except IOError: - warn_once("Encountered disk issue and Neptune will not be saving your data.", exception=NeptuneWarning) - else: - return func(*args, **kwargs) - - return wrapper +def ensure_disk_not_full( + non_raise_on_disk_issue: Optional[bool] = None, max_disc_utilization: Optional[float] = None +) -> Callable[[Callable[..., None]], Callable[..., None]]: + + non_raising_on_disk_issue = ( + NEPTUNE_NON_RAISING_ON_DISK_ISSUE in os.environ if non_raise_on_disk_issue is None else non_raise_on_disk_issue + ) + + max_disk_utilization = get_max_percentage_from_env() if max_disc_utilization is None else max_disc_utilization + + def ensure_disk_not_full_decorator(func: Callable[..., None]) -> Callable[..., None]: + @wraps(func) + def wrapper(*args: Tuple, **kwargs: Dict[str, Any]) -> None: + if non_raising_on_disk_issue: + try: + if max_disk_utilization: + current_utilization = get_disk_utilization_percent() + if current_utilization > max_disk_utilization: + warn_once( + f"Max disk utilization {max_disk_utilization}% exceeded with {current_utilization}." + f" Neptune will not be saving your data.", + exception=NeptuneWarning, + ) + return + + func(*args, **kwargs) + except (OSError, Error): + warn_once( + "Encountered disk issue and Neptune will not be saving your data.", exception=NeptuneWarning + ) + else: + return func(*args, **kwargs) + + return wrapper + + return ensure_disk_not_full_decorator diff --git a/tests/unit/neptune/new/internal/utils/test_full_disk.py b/tests/unit/neptune/new/internal/utils/test_full_disk.py new file mode 100644 index 000000000..a824cc6d6 --- /dev/null +++ b/tests/unit/neptune/new/internal/utils/test_full_disk.py @@ -0,0 +1,50 @@ +# +# Copyright (c) 2023, Neptune Labs Sp. z o.o. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import unittest +from io import UnsupportedOperation + +from mock import patch +from psutil import ( + AccessDenied, + Error, +) + +from neptune.internal.utils.disk_full import ensure_disk_not_full + + +@ensure_disk_not_full(True, 42) +def dummy_test_func(): + pass + + +class TestDiskFull(unittest.TestCase): + + # Catching OSError that's base error for all OS and IO errors. More info here: https://peps.python.org/pep-3151 + # Additionally, catching specific psutil's base error - psutil.Error. + # More info about psutil.Error here: https://psutil.readthedocs.io/en/latest/index.html#psutil.Error + @patch("neptune.internal.utils.disk_full.get_disk_utilization_percent") + def test_suppressing_of_env_errors(self, get_disk_utilization_percent): + env_errors = [OSError(), IOError(), EnvironmentError(), UnsupportedOperation(), Error(), AccessDenied()] + + for error in env_errors: + get_disk_utilization_percent.side_effect = error + dummy_test_func() # asserting is not required as expecting that any error will be caught + + non_env_errors = [ValueError(), OverflowError()] + for error in non_env_errors: + get_disk_utilization_percent.side_effect = error + with self.assertRaises(BaseException): + dummy_test_func() From bf6a2f308431e173000ca446c855c6a1fdea8b3b Mon Sep 17 00:00:00 2001 From: Artsiom Tserashkovich Date: Thu, 12 Oct 2023 12:11:56 +0200 Subject: [PATCH 2/7] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18dcf8efd..c2ca5916e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - Safety (errors suppressing) execution mode ([#1503](https://github.com/neptune-ai/neptune-client/pull/1503)) - Allow to disable handling of remote signals ([#1508](https://github.com/neptune-ai/neptune-client/pull/1508)) - Allow to disable deletion of local parent folder ([#1511](https://github.com/neptune-ai/neptune-client/pull/1511)) -- Made the disk checking more reliable for env specific errors ([]()) +- Made the disk checking more reliable for env specific errors ([#1519](https://github.com/neptune-ai/neptune-client/pull/1519)) ### Fixes - Added more safe checking to last ack ([#1510](https://github.com/neptune-ai/neptune-client/pull/1510)) From d97f81cb180eea959096c8944167430f0257c932 Mon Sep 17 00:00:00 2001 From: Artsiom Tserashkovich Date: Thu, 12 Oct 2023 15:47:56 +0200 Subject: [PATCH 3/7] fix failed tests --- .../internal/operation_processors/async_operation_processor.py | 2 +- .../operation_processors/offline_operation_processor.py | 2 +- .../internal/operation_processors/sync_operation_processor.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/neptune/internal/operation_processors/async_operation_processor.py b/src/neptune/internal/operation_processors/async_operation_processor.py index 8eb803b45..9fc281371 100644 --- a/src/neptune/internal/operation_processors/async_operation_processor.py +++ b/src/neptune/internal/operation_processors/async_operation_processor.py @@ -109,7 +109,7 @@ def _init_data_path(container_id: "UniqueId", container_type: "ContainerType") - process_path = f"exec-{now.timestamp()}-{now.strftime('%Y-%m-%d_%H.%M.%S.%f')}-{os.getpid()}" return get_container_dir(ASYNC_DIRECTORY, container_id, container_type, process_path) - @ensure_disk_not_full + @ensure_disk_not_full() def enqueue_operation(self, op: Operation, *, wait: bool) -> None: self._last_version = self._queue.put(op) diff --git a/src/neptune/internal/operation_processors/offline_operation_processor.py b/src/neptune/internal/operation_processors/offline_operation_processor.py index b2397db7b..c6e4dbf62 100644 --- a/src/neptune/internal/operation_processors/offline_operation_processor.py +++ b/src/neptune/internal/operation_processors/offline_operation_processor.py @@ -57,7 +57,7 @@ def __init__(self, container_id: "UniqueId", container_type: "ContainerType", lo def _init_data_path(container_id: "UniqueId", container_type: "ContainerType") -> "Path": return get_container_dir(OFFLINE_DIRECTORY, container_id, container_type) - @ensure_disk_not_full + @ensure_disk_not_full() def enqueue_operation(self, op: Operation, *, wait: bool) -> None: self._queue.put(op) diff --git a/src/neptune/internal/operation_processors/sync_operation_processor.py b/src/neptune/internal/operation_processors/sync_operation_processor.py index f4fae1660..65c275b65 100644 --- a/src/neptune/internal/operation_processors/sync_operation_processor.py +++ b/src/neptune/internal/operation_processors/sync_operation_processor.py @@ -52,7 +52,7 @@ def _init_data_path(container_id: "UniqueId", container_type: "ContainerType") - process_path = f"exec-{now.timestamp()}-{now.strftime('%Y-%m-%d_%H.%M.%S.%f')}-{os.getpid()}" return get_container_dir(SYNC_DIRECTORY, container_id, container_type, process_path) - @ensure_disk_not_full + @ensure_disk_not_full() def enqueue_operation(self, op: "Operation", *, wait: bool) -> None: _, errors = self._backend.execute_operations( container_id=self._container_id, From 2a42f34be5faf1432266d4fd969770cb8322e828 Mon Sep 17 00:00:00 2001 From: Artsiom Tserashkovich Date: Thu, 12 Oct 2023 17:04:58 +0200 Subject: [PATCH 4/7] Change condition for checking of disk usage --- src/neptune/internal/utils/disk_full.py | 2 +- .../new/internal/utils/test_full_disk.py | 25 ++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/neptune/internal/utils/disk_full.py b/src/neptune/internal/utils/disk_full.py index 0df2c3fd7..8afa2f6ae 100644 --- a/src/neptune/internal/utils/disk_full.py +++ b/src/neptune/internal/utils/disk_full.py @@ -78,7 +78,7 @@ def wrapper(*args: Tuple, **kwargs: Dict[str, Any]) -> None: try: if max_disk_utilization: current_utilization = get_disk_utilization_percent() - if current_utilization > max_disk_utilization: + if current_utilization >= max_disk_utilization: warn_once( f"Max disk utilization {max_disk_utilization}% exceeded with {current_utilization}." f" Neptune will not be saving your data.", diff --git a/tests/unit/neptune/new/internal/utils/test_full_disk.py b/tests/unit/neptune/new/internal/utils/test_full_disk.py index a824cc6d6..ee40010f0 100644 --- a/tests/unit/neptune/new/internal/utils/test_full_disk.py +++ b/tests/unit/neptune/new/internal/utils/test_full_disk.py @@ -16,7 +16,10 @@ import unittest from io import UnsupportedOperation -from mock import patch +from mock import ( + MagicMock, + patch, +) from psutil import ( AccessDenied, Error, @@ -48,3 +51,23 @@ def test_suppressing_of_env_errors(self, get_disk_utilization_percent): get_disk_utilization_percent.side_effect = error with self.assertRaises(BaseException): dummy_test_func() + + @patch("neptune.internal.utils.disk_full.get_disk_utilization_percent") + def test_not_called_with_usage_100_percent(self, get_disk_utilization_percent): + get_disk_utilization_percent.return_value = 100 + mocked_func = MagicMock() + wrapped_func = ensure_disk_not_full(True, 100)(mocked_func) + + wrapped_func() + + mocked_func.assert_not_called() + + @patch("neptune.internal.utils.disk_full.get_disk_utilization_percent") + def test_called_when_usage_less_than_limit(self, get_disk_utilization_percent): + get_disk_utilization_percent.return_value = 99 + mocked_func = MagicMock() + wrapped_func = ensure_disk_not_full(True, 100)(mocked_func) + + wrapped_func() + + mocked_func.assert_called_once() From 649c134354a1f558f6cf3c91e71caac3a14d12f1 Mon Sep 17 00:00:00 2001 From: Artsiom Tserashkovich Date: Thu, 12 Oct 2023 17:16:00 +0200 Subject: [PATCH 5/7] Change tests flows for full_disk --- .../new/internal/utils/test_full_disk.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/unit/neptune/new/internal/utils/test_full_disk.py b/tests/unit/neptune/new/internal/utils/test_full_disk.py index ee40010f0..d1afce30c 100644 --- a/tests/unit/neptune/new/internal/utils/test_full_disk.py +++ b/tests/unit/neptune/new/internal/utils/test_full_disk.py @@ -28,11 +28,6 @@ from neptune.internal.utils.disk_full import ensure_disk_not_full -@ensure_disk_not_full(True, 42) -def dummy_test_func(): - pass - - class TestDiskFull(unittest.TestCase): # Catching OSError that's base error for all OS and IO errors. More info here: https://peps.python.org/pep-3151 @@ -41,16 +36,23 @@ class TestDiskFull(unittest.TestCase): @patch("neptune.internal.utils.disk_full.get_disk_utilization_percent") def test_suppressing_of_env_errors(self, get_disk_utilization_percent): env_errors = [OSError(), IOError(), EnvironmentError(), UnsupportedOperation(), Error(), AccessDenied()] - for error in env_errors: + mocked_func = MagicMock() + wrapped_func = ensure_disk_not_full(True, 100)(mocked_func) get_disk_utilization_percent.side_effect = error - dummy_test_func() # asserting is not required as expecting that any error will be caught + + wrapped_func() # asserting is not required as expecting that any error will be caught + mocked_func.assert_not_called() non_env_errors = [ValueError(), OverflowError()] for error in non_env_errors: + mocked_func = MagicMock() + wrapped_func = ensure_disk_not_full(True, 100)(mocked_func) get_disk_utilization_percent.side_effect = error + with self.assertRaises(BaseException): - dummy_test_func() + wrapped_func() + mocked_func.assert_not_called() @patch("neptune.internal.utils.disk_full.get_disk_utilization_percent") def test_not_called_with_usage_100_percent(self, get_disk_utilization_percent): From aadb6fd71752f3e54e12878c7db4a835f8d811e8 Mon Sep 17 00:00:00 2001 From: Artsiom Tserashkovich Date: Thu, 12 Oct 2023 17:28:07 +0200 Subject: [PATCH 6/7] Revert changes of ensure_disk_not_full decorator --- .../async_operation_processor.py | 2 +- .../offline_operation_processor.py | 2 +- .../sync_operation_processor.py | 2 +- src/neptune/internal/utils/disk_full.py | 63 ++++++++----------- .../new/internal/utils/test_full_disk.py | 26 +++++--- 5 files changed, 49 insertions(+), 46 deletions(-) diff --git a/src/neptune/internal/operation_processors/async_operation_processor.py b/src/neptune/internal/operation_processors/async_operation_processor.py index 9fc281371..8eb803b45 100644 --- a/src/neptune/internal/operation_processors/async_operation_processor.py +++ b/src/neptune/internal/operation_processors/async_operation_processor.py @@ -109,7 +109,7 @@ def _init_data_path(container_id: "UniqueId", container_type: "ContainerType") - process_path = f"exec-{now.timestamp()}-{now.strftime('%Y-%m-%d_%H.%M.%S.%f')}-{os.getpid()}" return get_container_dir(ASYNC_DIRECTORY, container_id, container_type, process_path) - @ensure_disk_not_full() + @ensure_disk_not_full def enqueue_operation(self, op: Operation, *, wait: bool) -> None: self._last_version = self._queue.put(op) diff --git a/src/neptune/internal/operation_processors/offline_operation_processor.py b/src/neptune/internal/operation_processors/offline_operation_processor.py index c6e4dbf62..b2397db7b 100644 --- a/src/neptune/internal/operation_processors/offline_operation_processor.py +++ b/src/neptune/internal/operation_processors/offline_operation_processor.py @@ -57,7 +57,7 @@ def __init__(self, container_id: "UniqueId", container_type: "ContainerType", lo def _init_data_path(container_id: "UniqueId", container_type: "ContainerType") -> "Path": return get_container_dir(OFFLINE_DIRECTORY, container_id, container_type) - @ensure_disk_not_full() + @ensure_disk_not_full def enqueue_operation(self, op: Operation, *, wait: bool) -> None: self._queue.put(op) diff --git a/src/neptune/internal/operation_processors/sync_operation_processor.py b/src/neptune/internal/operation_processors/sync_operation_processor.py index 65c275b65..f4fae1660 100644 --- a/src/neptune/internal/operation_processors/sync_operation_processor.py +++ b/src/neptune/internal/operation_processors/sync_operation_processor.py @@ -52,7 +52,7 @@ def _init_data_path(container_id: "UniqueId", container_type: "ContainerType") - process_path = f"exec-{now.timestamp()}-{now.strftime('%Y-%m-%d_%H.%M.%S.%f')}-{os.getpid()}" return get_container_dir(SYNC_DIRECTORY, container_id, container_type, process_path) - @ensure_disk_not_full() + @ensure_disk_not_full def enqueue_operation(self, op: "Operation", *, wait: bool) -> None: _, errors = self._backend.execute_operations( container_id=self._container_id, diff --git a/src/neptune/internal/utils/disk_full.py b/src/neptune/internal/utils/disk_full.py index 8afa2f6ae..c558576ab 100644 --- a/src/neptune/internal/utils/disk_full.py +++ b/src/neptune/internal/utils/disk_full.py @@ -61,39 +61,30 @@ def get_max_percentage_from_env() -> Optional[float]: return None -def ensure_disk_not_full( - non_raise_on_disk_issue: Optional[bool] = None, max_disc_utilization: Optional[float] = None -) -> Callable[[Callable[..., None]], Callable[..., None]]: - - non_raising_on_disk_issue = ( - NEPTUNE_NON_RAISING_ON_DISK_ISSUE in os.environ if non_raise_on_disk_issue is None else non_raise_on_disk_issue - ) - - max_disk_utilization = get_max_percentage_from_env() if max_disc_utilization is None else max_disc_utilization - - def ensure_disk_not_full_decorator(func: Callable[..., None]) -> Callable[..., None]: - @wraps(func) - def wrapper(*args: Tuple, **kwargs: Dict[str, Any]) -> None: - if non_raising_on_disk_issue: - try: - if max_disk_utilization: - current_utilization = get_disk_utilization_percent() - if current_utilization >= max_disk_utilization: - warn_once( - f"Max disk utilization {max_disk_utilization}% exceeded with {current_utilization}." - f" Neptune will not be saving your data.", - exception=NeptuneWarning, - ) - return - - func(*args, **kwargs) - except (OSError, Error): - warn_once( - "Encountered disk issue and Neptune will not be saving your data.", exception=NeptuneWarning - ) - else: - return func(*args, **kwargs) - - return wrapper - - return ensure_disk_not_full_decorator +def ensure_disk_not_full(func: Callable[..., None]) -> Callable[..., None]: + + non_raising_on_disk_issue = NEPTUNE_NON_RAISING_ON_DISK_ISSUE in os.environ + + max_disk_utilization = get_max_percentage_from_env() + + @wraps(func) + def wrapper(*args: Tuple, **kwargs: Dict[str, Any]) -> None: + if non_raising_on_disk_issue: + try: + if max_disk_utilization: + current_utilization = get_disk_utilization_percent() + if current_utilization >= max_disk_utilization: + warn_once( + f"Max disk utilization {max_disk_utilization}% exceeded with {current_utilization}." + f" Neptune will not be saving your data.", + exception=NeptuneWarning, + ) + return + + func(*args, **kwargs) + except (OSError, Error): + warn_once("Encountered disk issue and Neptune will not be saving your data.", exception=NeptuneWarning) + else: + return func(*args, **kwargs) + + return wrapper diff --git a/tests/unit/neptune/new/internal/utils/test_full_disk.py b/tests/unit/neptune/new/internal/utils/test_full_disk.py index d1afce30c..2fac3c03e 100644 --- a/tests/unit/neptune/new/internal/utils/test_full_disk.py +++ b/tests/unit/neptune/new/internal/utils/test_full_disk.py @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # +import os import unittest from io import UnsupportedOperation @@ -25,6 +26,7 @@ Error, ) +from neptune.envs import NEPTUNE_NON_RAISING_ON_DISK_ISSUE from neptune.internal.utils.disk_full import ensure_disk_not_full @@ -33,12 +35,16 @@ class TestDiskFull(unittest.TestCase): # Catching OSError that's base error for all OS and IO errors. More info here: https://peps.python.org/pep-3151 # Additionally, catching specific psutil's base error - psutil.Error. # More info about psutil.Error here: https://psutil.readthedocs.io/en/latest/index.html#psutil.Error + @patch.dict(os.environ, {NEPTUNE_NON_RAISING_ON_DISK_ISSUE: "True"}) + @patch("neptune.internal.utils.disk_full.get_max_percentage_from_env") @patch("neptune.internal.utils.disk_full.get_disk_utilization_percent") - def test_suppressing_of_env_errors(self, get_disk_utilization_percent): + def test_suppressing_of_env_errors(self, get_disk_utilization_percent, get_max_percentage_from_env): + get_max_percentage_from_env.return_value = 42 + env_errors = [OSError(), IOError(), EnvironmentError(), UnsupportedOperation(), Error(), AccessDenied()] for error in env_errors: mocked_func = MagicMock() - wrapped_func = ensure_disk_not_full(True, 100)(mocked_func) + wrapped_func = ensure_disk_not_full(mocked_func) get_disk_utilization_percent.side_effect = error wrapped_func() # asserting is not required as expecting that any error will be caught @@ -47,28 +53,34 @@ def test_suppressing_of_env_errors(self, get_disk_utilization_percent): non_env_errors = [ValueError(), OverflowError()] for error in non_env_errors: mocked_func = MagicMock() - wrapped_func = ensure_disk_not_full(True, 100)(mocked_func) + wrapped_func = ensure_disk_not_full(mocked_func) get_disk_utilization_percent.side_effect = error with self.assertRaises(BaseException): wrapped_func() mocked_func.assert_not_called() + @patch.dict(os.environ, {NEPTUNE_NON_RAISING_ON_DISK_ISSUE: "True"}) + @patch("neptune.internal.utils.disk_full.get_max_percentage_from_env") @patch("neptune.internal.utils.disk_full.get_disk_utilization_percent") - def test_not_called_with_usage_100_percent(self, get_disk_utilization_percent): + def test_not_called_with_usage_100_percent(self, get_disk_utilization_percent, get_max_percentage_from_env): + get_max_percentage_from_env.return_value = 100 get_disk_utilization_percent.return_value = 100 mocked_func = MagicMock() - wrapped_func = ensure_disk_not_full(True, 100)(mocked_func) + wrapped_func = ensure_disk_not_full(mocked_func) wrapped_func() mocked_func.assert_not_called() + @patch.dict(os.environ, {NEPTUNE_NON_RAISING_ON_DISK_ISSUE: "True"}) + @patch("neptune.internal.utils.disk_full.get_max_percentage_from_env") @patch("neptune.internal.utils.disk_full.get_disk_utilization_percent") - def test_called_when_usage_less_than_limit(self, get_disk_utilization_percent): + def test_called_when_usage_less_than_limit(self, get_disk_utilization_percent, get_max_percentage_from_env): + get_max_percentage_from_env.return_value = 100 get_disk_utilization_percent.return_value = 99 mocked_func = MagicMock() - wrapped_func = ensure_disk_not_full(True, 100)(mocked_func) + wrapped_func = ensure_disk_not_full(mocked_func) wrapped_func() From 3390727593eeb007950ffdcfe298e311953b4cd3 Mon Sep 17 00:00:00 2001 From: Artsiom Tserashkovich Date: Thu, 12 Oct 2023 17:29:03 +0200 Subject: [PATCH 7/7] Remove redundant lines --- src/neptune/internal/utils/disk_full.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/neptune/internal/utils/disk_full.py b/src/neptune/internal/utils/disk_full.py index c558576ab..64265981d 100644 --- a/src/neptune/internal/utils/disk_full.py +++ b/src/neptune/internal/utils/disk_full.py @@ -62,9 +62,7 @@ def get_max_percentage_from_env() -> Optional[float]: def ensure_disk_not_full(func: Callable[..., None]) -> Callable[..., None]: - non_raising_on_disk_issue = NEPTUNE_NON_RAISING_ON_DISK_ISSUE in os.environ - max_disk_utilization = get_max_percentage_from_env() @wraps(func)