From 222ea0e198cf02fb0bfab1d1ced6feb31a958e9f Mon Sep 17 00:00:00 2001 From: Daniel Roussel Date: Wed, 29 Nov 2023 16:13:54 +0100 Subject: [PATCH 1/2] Fix quantity unit of production run may be None. We recently made quantity units of production runs optional in the upstream service, so we have to make the same change here as well. --- src/enlyze/api_clients/production_runs/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/enlyze/api_clients/production_runs/models.py b/src/enlyze/api_clients/production_runs/models.py index 37bcfb0..192c2d3 100644 --- a/src/enlyze/api_clients/production_runs/models.py +++ b/src/enlyze/api_clients/production_runs/models.py @@ -47,7 +47,7 @@ def to_user_model(self) -> user_models.Product: class Quantity(ProductionRunsApiModel): - unit: str + unit: str | None value: float def to_user_model(self) -> user_models.Quantity: From 5a3dafb2963aa4fcb2f08af6430fe05ccf2714e3 Mon Sep 17 00:00:00 2001 From: Daniel Roussel Date: Wed, 29 Nov 2023 16:26:07 +0100 Subject: [PATCH 2/2] also allow None for unit in user model --- src/enlyze/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/enlyze/models.py b/src/enlyze/models.py index 429965b..fa0b9d9 100644 --- a/src/enlyze/models.py +++ b/src/enlyze/models.py @@ -222,7 +222,7 @@ class Quantity: """Representation of a physical quantity""" #: Physical unit of quantity - unit: str + unit: str | None #: The quantity expressed in `unit` value: float