From 9a085136f6bf9d372c7cd61615458c6e64887055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Jankowski?= Date: Tue, 7 Sep 2021 11:45:36 +0200 Subject: [PATCH] Added capture_traceback in neptune.init (#676) --- CHANGELOG.md | 5 +++++ neptune/new/internal/init_impl.py | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b4859a8c..3086912d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## neptune-client 0.10.9 [UNRELEASED] + +### Features +- Added capture_traceback in neptune.init() ([#676](https://github.com/neptune-ai/neptune-client/pull/676)) + ## neptune-client 0.10.8 ### Fixes diff --git a/neptune/new/internal/init_impl.py b/neptune/new/internal/init_impl.py index 2eceebfb5..32fc0921a 100644 --- a/neptune/new/internal/init_impl.py +++ b/neptune/new/internal/init_impl.py @@ -111,6 +111,7 @@ def init(project: Optional[str] = None, monitoring_namespace: Optional[str] = None, flush_period: float = 5, proxies: Optional[dict] = None, + capture_traceback: bool = True, **kwargs) -> Run: """Starts a new tracked run, and append it to the top of the Runs table view. @@ -158,6 +159,9 @@ def init(project: Optional[str] = None, proxies (dict of str, optional): Argument passed to HTTP calls made via the Requests library. For more information see `their proxies section `_. + capture_traceback (bool, optional): Whether to send run’s traceback in case of an exception. + Defaults to `True`. + Tracked metadata will be stored inside `monitoring/traceback`. Returns: ``Run``: object that is used to manage the tracked run and log metadata to it. @@ -218,6 +222,7 @@ def init(project: Optional[str] = None, verify_type("monitoring_namespace", monitoring_namespace, (str, type(None))) verify_type("flush_period", flush_period, (int, float)) verify_type("proxies", proxies, (dict, type(None))) + verify_type("capture_traceback", capture_hardware_metrics, bool) if tags is not None: if isinstance(tags, str): tags = [tags] @@ -326,7 +331,8 @@ def init(project: Optional[str] = None, websockets_factory = backend.websockets_factory(project_obj.uuid, api_run.uuid) if websockets_factory: background_jobs.append(WebsocketSignalsBackgroundJob(websockets_factory)) - background_jobs.append(TracebackJob(traceback_path, fail_on_exception)) + if capture_traceback: + background_jobs.append(TracebackJob(traceback_path, fail_on_exception)) background_jobs.append(PingBackgroundJob()) _run = Run(api_run.uuid, backend, operation_processor, BackgroundJobList(background_jobs), run_lock,