From facccf80f6b4f8b3d0184b11d4a9004b0f4228ae Mon Sep 17 00:00:00 2001 From: Alexander Reynolds Date: Wed, 4 Sep 2024 18:45:33 -0400 Subject: [PATCH 1/2] still optional in the returns --- nominal/sdk.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nominal/sdk.py b/nominal/sdk.py index 0c73b87b..86b0cf04 100644 --- a/nominal/sdk.py +++ b/nominal/sdk.py @@ -145,7 +145,7 @@ def _from_conjure(cls, nominal_client: NominalClient, run: scout_run_api.Run) -> properties=MappingProxyType(run.properties), labels=tuple(run.labels), start=_conjure_time_to_integral_nanoseconds(run.start_time), - end=(_conjure_time_to_integral_nanoseconds(run.end_time) if run.end_time else None), + end=None if run.end_time is None else _conjure_time_to_integral_nanoseconds(run.end_time), _client=nominal_client, ) @@ -367,7 +367,7 @@ def create_run( title: str, description: str, start_time: datetime | IntegralNanosecondsUTC, - end_time: datetime | IntegralNanosecondsUTC | None = None, + end_time: datetime | IntegralNanosecondsUTC, *, datasets: Mapping[str, str] | None = None, labels: Sequence[str] = (), @@ -381,7 +381,7 @@ def create_run( retrieved from `Dataset.rid` after getting or creating a dataset. """ start_abs = _flexible_time_to_conjure_scout_run_api(start_time) - end_abs = _flexible_time_to_conjure_scout_run_api(end_time) if end_time else None + end_abs = _flexible_time_to_conjure_scout_run_api(end_time) datasets = datasets or {} request = scout_run_api.CreateRunRequest( attachments=list(attachment_rids), From 8b479962b905a1d55d31423d906bab11bf2e81eb Mon Sep 17 00:00:00 2001 From: Alexander Reynolds Date: Wed, 4 Sep 2024 18:48:14 -0400 Subject: [PATCH 2/2] keep equivalent older code for smaller diff --- nominal/sdk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nominal/sdk.py b/nominal/sdk.py index 86b0cf04..341503bf 100644 --- a/nominal/sdk.py +++ b/nominal/sdk.py @@ -145,7 +145,7 @@ def _from_conjure(cls, nominal_client: NominalClient, run: scout_run_api.Run) -> properties=MappingProxyType(run.properties), labels=tuple(run.labels), start=_conjure_time_to_integral_nanoseconds(run.start_time), - end=None if run.end_time is None else _conjure_time_to_integral_nanoseconds(run.end_time), + end=(_conjure_time_to_integral_nanoseconds(run.end_time) if run.end_time else None), _client=nominal_client, )