From 9921c9b5e7d51d828e578b9eac6841bfd29b6b0b Mon Sep 17 00:00:00 2001 From: Hrushikesh Sahasrabuddhe Date: Wed, 30 Aug 2023 13:20:32 -0700 Subject: [PATCH 01/14] added moto to tests --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 077f5ffc..e8d33290 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ docs = [ "sphinx==7.2.4", ] dev = ["pre-commit>=2.12.1"] -tests = ["pytest-cov==4.1.0", "pytest==7.4.0"] +tests = ["pytest-cov==4.1.0", "pytest==7.4.0", "moto==4.2.0"] vis = ["matplotlib", "pydot"] fireworks = ["FireWorks"] strict = [ From f94915c4dd5c97db95c660a7396d850c9ad48865 Mon Sep 17 00:00:00 2001 From: Hrushikesh Sahasrabuddhe Date: Wed, 30 Aug 2023 19:23:49 -0700 Subject: [PATCH 02/14] updated job store class --- src/jobflow/core/job.py | 20 +++++++++++--------- src/jobflow/core/job_store.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 src/jobflow/core/job_store.py diff --git a/src/jobflow/core/job.py b/src/jobflow/core/job.py index cd9f19f6..2b8b9152 100644 --- a/src/jobflow/core/job.py +++ b/src/jobflow/core/job.py @@ -9,6 +9,7 @@ from monty.json import MSONable, jsanitize +from jobflow.core.job_store import JobStoreDocument from jobflow.core.reference import OnMissing, OutputReference from jobflow.utils.uuid import suuid @@ -633,15 +634,16 @@ def run(self, store: jobflow.JobStore) -> Response: ) from err save = {k: "output" if v is True else v for k, v in self._kwargs.items()} - data = { - "uuid": self.uuid, - "index": self.index, - "output": output, - "completed_at": datetime.now().isoformat(), - "metadata": self.metadata, - "hosts": self.hosts, - "name": self.name, - } + data = JobStoreDocument( + uuid=self.uuid, + index=self.index, + output=output, + completed_at=datetime.now().isoformat(), + metadata=self.metadata, + hosts=self.hosts, + name=self.name, + ) + # Need to do changes to .update method store.update(data, key=["uuid", "index"], save=save) CURRENT_JOB.reset() diff --git a/src/jobflow/core/job_store.py b/src/jobflow/core/job_store.py new file mode 100644 index 00000000..a4b0e935 --- /dev/null +++ b/src/jobflow/core/job_store.py @@ -0,0 +1,34 @@ +"""A Pydantic model for Jobstore document.""" + +import typing + +from pydantic import BaseModel, Field + + +class JobStoreDocument(BaseModel): + """A Pydantic model for Jobstore document.""" + + uuid: str = Field( + None, description="A unique identifier for the job. Generated automatically." + ) + index: int = Field( + None, + description="The index of the job (number of times the job has been replaced.", + ) + output: typing.Any = Field( + None, + description="This is a reference to the future job outpu.", + ) + completed_at: str = Field(None, description="The time the job was completed.") + metadata: dict = Field( + None, + description="Metadeta information supplied by the user.", + ) + hosts: list[str] = Field( + None, + description="The list of UUIDs of the hosts containing the job.", + ) + name: str = Field( + None, + description="The name of the job.", + ) From 08d8d9309917b0bc586bc8501be6743df8a29731 Mon Sep 17 00:00:00 2001 From: Hrushikesh Sahasrabuddhe Date: Fri, 8 Sep 2023 13:20:26 -0700 Subject: [PATCH 03/14] Changing the document parse type from dict to Pydantic --- src/jobflow/core/job.py | 2 +- src/jobflow/core/store.py | 3 +- src/jobflow/{core => schemas}/job_store.py | 0 tests/core/test_job_output_schema.py | 97 ++++++++++++++++++++++ 4 files changed, 100 insertions(+), 2 deletions(-) rename src/jobflow/{core => schemas}/job_store.py (100%) create mode 100644 tests/core/test_job_output_schema.py diff --git a/src/jobflow/core/job.py b/src/jobflow/core/job.py index 2b8b9152..7dd7f45a 100644 --- a/src/jobflow/core/job.py +++ b/src/jobflow/core/job.py @@ -9,8 +9,8 @@ from monty.json import MSONable, jsanitize -from jobflow.core.job_store import JobStoreDocument from jobflow.core.reference import OnMissing, OutputReference +from jobflow.schemas.job_store import JobStoreDocument from jobflow.utils.uuid import suuid if typing.TYPE_CHECKING: diff --git a/src/jobflow/core/store.py b/src/jobflow/core/store.py index b665e3cd..4b43f318 100644 --- a/src/jobflow/core/store.py +++ b/src/jobflow/core/store.py @@ -8,6 +8,7 @@ from monty.json import MSONable from jobflow.core.reference import OnMissing +from jobflow.schemas.job_store import JobStoreDocument from jobflow.utils.find import get_root_locations if typing.TYPE_CHECKING: @@ -254,7 +255,7 @@ def query_one( def update( self, - docs: list[dict] | dict, + docs: list[dict] | dict | JobStoreDocument | list[JobStoreDocument], key: list | str = None, save: bool | save_type = None, ): diff --git a/src/jobflow/core/job_store.py b/src/jobflow/schemas/job_store.py similarity index 100% rename from src/jobflow/core/job_store.py rename to src/jobflow/schemas/job_store.py diff --git a/tests/core/test_job_output_schema.py b/tests/core/test_job_output_schema.py new file mode 100644 index 00000000..38ffc7ac --- /dev/null +++ b/tests/core/test_job_output_schema.py @@ -0,0 +1,97 @@ +from datetime import datetime + +import pytest + +from jobflow import JobStore +from jobflow.schemas.job_store import JobStoreDocument + + +@pytest.fixture +def memory_store(): + from maggma.stores import MemoryStore + + store = MemoryStore() + store.connect() + return store + + +@pytest.fixture +def sample_data(): + return JobStoreDocument( + uuid="abc123", + index=1, + output=None, + completed_at=datetime.now().isoformat(), + metadata={"key": "value"}, + hosts=["host1", "host2"], + name="my_job", + ) + + +def test_job_store_document_model(sample_data): + # Test creating model + data = sample_data + + assert data.uuid == "abc123" + assert data.index == 1 + assert data.output is None + assert datetime.fromisoformat(data.completed_at).hour == datetime.now().hour + assert data.metadata == {"key": "value"} + assert data.hosts == ["host1", "host2"] + assert data.name == "my_job" + + +def test_job_store_update(memory_store, sample_data): + # Storing document as a JobStoreDocument + store = JobStore(memory_store) + store.connect() + d = { + "index": 1, + "uuid": "abc123", + "metadata": {"key": "value"}, + "hosts": ["host1", "host2"], + "name": "my_job", + "e": 6, + "d": 4, + } + sample_data = JobStoreDocument(**d) + store.update(sample_data) + + # Check document was inserted + results = store.query_one(criteria={"hosts": {"$exists": 1}}) + assert results["index"] == 1 + assert results["uuid"] == "abc123" + assert results["metadata"] == {"key": "value"} + assert results["hosts"] == ["host1", "host2"] + assert results["name"] == "my_job" + assert "e" not in results + assert "d" not in results + + # Further checks to see if two documents get inserted + e = d.copy() + e["uuid"] = "def456" + new_data_e = JobStoreDocument(**e) + f = d.copy() + f["uuid"] = "ghi789" + new_data_f = JobStoreDocument(**f) + store.update([new_data_e, new_data_f]) + + # Check if document new_data_e is present in the store + results = store.query_one(criteria={"uuid": "def456"}) + assert results["index"] == 1 + assert results["uuid"] == "def456" + assert results["metadata"] == {"key": "value"} + assert results["hosts"] == ["host1", "host2"] + assert results["name"] == "my_job" + assert "e" not in results + assert "d" not in results + + # Check if document new_data_f is present in the store + results = store.query_one(criteria={"uuid": "ghi789"}) + assert results["index"] == 1 + assert results["uuid"] == "ghi789" + assert results["metadata"] == {"key": "value"} + assert results["hosts"] == ["host1", "host2"] + assert results["name"] == "my_job" + assert "e" not in results + assert "d" not in results From 172fbcabd0a0f18651c051fc65a8d2a58b7f49fb Mon Sep 17 00:00:00 2001 From: Hrushikesh Sahasrabuddhe Date: Fri, 8 Sep 2023 14:17:36 -0700 Subject: [PATCH 04/14] using the 'memory_job_store' fixture --- tests/core/test_job_output_schema.py | 30 ++++++++++------------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/tests/core/test_job_output_schema.py b/tests/core/test_job_output_schema.py index 38ffc7ac..72f891f5 100644 --- a/tests/core/test_job_output_schema.py +++ b/tests/core/test_job_output_schema.py @@ -2,21 +2,11 @@ import pytest -from jobflow import JobStore -from jobflow.schemas.job_store import JobStoreDocument - - -@pytest.fixture -def memory_store(): - from maggma.stores import MemoryStore - - store = MemoryStore() - store.connect() - return store - @pytest.fixture def sample_data(): + from jobflow.schemas.job_store import JobStoreDocument + return JobStoreDocument( uuid="abc123", index=1, @@ -41,10 +31,10 @@ def test_job_store_document_model(sample_data): assert data.name == "my_job" -def test_job_store_update(memory_store, sample_data): +def test_job_store_update(memory_jobstore, sample_data): # Storing document as a JobStoreDocument - store = JobStore(memory_store) - store.connect() + from jobflow.schemas.job_store import JobStoreDocument + d = { "index": 1, "uuid": "abc123", @@ -55,10 +45,10 @@ def test_job_store_update(memory_store, sample_data): "d": 4, } sample_data = JobStoreDocument(**d) - store.update(sample_data) + memory_jobstore.update(sample_data) # Check document was inserted - results = store.query_one(criteria={"hosts": {"$exists": 1}}) + results = memory_jobstore.query_one(criteria={"hosts": {"$exists": 1}}) assert results["index"] == 1 assert results["uuid"] == "abc123" assert results["metadata"] == {"key": "value"} @@ -74,10 +64,10 @@ def test_job_store_update(memory_store, sample_data): f = d.copy() f["uuid"] = "ghi789" new_data_f = JobStoreDocument(**f) - store.update([new_data_e, new_data_f]) + memory_jobstore.update([new_data_e, new_data_f]) # Check if document new_data_e is present in the store - results = store.query_one(criteria={"uuid": "def456"}) + results = memory_jobstore.query_one(criteria={"uuid": "def456"}) assert results["index"] == 1 assert results["uuid"] == "def456" assert results["metadata"] == {"key": "value"} @@ -87,7 +77,7 @@ def test_job_store_update(memory_store, sample_data): assert "d" not in results # Check if document new_data_f is present in the store - results = store.query_one(criteria={"uuid": "ghi789"}) + results = memory_jobstore.query_one(criteria={"uuid": "ghi789"}) assert results["index"] == 1 assert results["uuid"] == "ghi789" assert results["metadata"] == {"key": "value"} From fed9c2a5bc520e4f88a719acb8f5a024b0ffbd01 Mon Sep 17 00:00:00 2001 From: Hrushikesh Sahasrabuddhe Date: Fri, 8 Sep 2023 14:33:57 -0700 Subject: [PATCH 05/14] fix mypy for job_store.py --- src/jobflow/schemas/job_store.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jobflow/schemas/job_store.py b/src/jobflow/schemas/job_store.py index a4b0e935..331c48b4 100644 --- a/src/jobflow/schemas/job_store.py +++ b/src/jobflow/schemas/job_store.py @@ -9,7 +9,7 @@ class JobStoreDocument(BaseModel): """A Pydantic model for Jobstore document.""" uuid: str = Field( - None, description="A unique identifier for the job. Generated automatically." + None, description="An unique identifier for the job. Generated automatically." ) index: int = Field( None, From 120b35c4d71e9d077203500c26555f43101847ea Mon Sep 17 00:00:00 2001 From: Hrushikesh Sahasrabuddhe Date: Fri, 8 Sep 2023 14:42:16 -0700 Subject: [PATCH 06/14] modifiying datatype from List to typing.List --- src/jobflow/schemas/job_store.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jobflow/schemas/job_store.py b/src/jobflow/schemas/job_store.py index 331c48b4..6fb8ddc7 100644 --- a/src/jobflow/schemas/job_store.py +++ b/src/jobflow/schemas/job_store.py @@ -24,7 +24,7 @@ class JobStoreDocument(BaseModel): None, description="Metadeta information supplied by the user.", ) - hosts: list[str] = Field( + hosts: typing.List[str] = Field( None, description="The list of UUIDs of the hosts containing the job.", ) From 1430909792e2f922438da25e483bdfd18cf090a5 Mon Sep 17 00:00:00 2001 From: Hrushikesh Sahasrabuddhe Date: Fri, 8 Sep 2023 15:22:51 -0700 Subject: [PATCH 07/14] refracting the name of job_store.py to job_output_schema.py, to maintain consitency with the name of it's test file --- src/jobflow/schemas/{job_store.py => job_output_schema.py} | 0 tests/core/test_job_output_schema.py | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename src/jobflow/schemas/{job_store.py => job_output_schema.py} (100%) diff --git a/src/jobflow/schemas/job_store.py b/src/jobflow/schemas/job_output_schema.py similarity index 100% rename from src/jobflow/schemas/job_store.py rename to src/jobflow/schemas/job_output_schema.py diff --git a/tests/core/test_job_output_schema.py b/tests/core/test_job_output_schema.py index 72f891f5..99777e7e 100644 --- a/tests/core/test_job_output_schema.py +++ b/tests/core/test_job_output_schema.py @@ -5,7 +5,7 @@ @pytest.fixture def sample_data(): - from jobflow.schemas.job_store import JobStoreDocument + from jobflow.schemas.job_output_schema import JobStoreDocument return JobStoreDocument( uuid="abc123", @@ -33,7 +33,7 @@ def test_job_store_document_model(sample_data): def test_job_store_update(memory_jobstore, sample_data): # Storing document as a JobStoreDocument - from jobflow.schemas.job_store import JobStoreDocument + from jobflow.schemas.job_output_schema import JobStoreDocument d = { "index": 1, From 34984db51c1a2355093253a01c49ae552ccc9c9a Mon Sep 17 00:00:00 2001 From: Hrushikesh Sahasrabuddhe Date: Fri, 8 Sep 2023 15:35:12 -0700 Subject: [PATCH 08/14] bug fix --- src/jobflow/core/job.py | 2 +- src/jobflow/core/store.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jobflow/core/job.py b/src/jobflow/core/job.py index bf98bcff..5acf9bf5 100644 --- a/src/jobflow/core/job.py +++ b/src/jobflow/core/job.py @@ -10,7 +10,7 @@ from monty.json import MSONable, jsanitize from jobflow.core.reference import OnMissing, OutputReference -from jobflow.schemas.job_store import JobStoreDocument +from jobflow.schemas.job_output_schema import JobStoreDocument from jobflow.utils.uuid import suuid if typing.TYPE_CHECKING: diff --git a/src/jobflow/core/store.py b/src/jobflow/core/store.py index 4b43f318..8968cfad 100644 --- a/src/jobflow/core/store.py +++ b/src/jobflow/core/store.py @@ -8,7 +8,7 @@ from monty.json import MSONable from jobflow.core.reference import OnMissing -from jobflow.schemas.job_store import JobStoreDocument +from jobflow.schemas.job_output_schema import JobStoreDocument from jobflow.utils.find import get_root_locations if typing.TYPE_CHECKING: From 39ae63087583a3149fe0a1867fdac90a10421ce3 Mon Sep 17 00:00:00 2001 From: Hrushikesh Sahasrabuddhe Date: Wed, 20 Sep 2023 18:26:08 -0700 Subject: [PATCH 09/14] adding validator to output attribute --- src/jobflow/core/job.py | 2 +- src/jobflow/schemas/job_output_schema.py | 34 ++++++++++++++++++++---- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/jobflow/core/job.py b/src/jobflow/core/job.py index 5acf9bf5..8f1dbea2 100644 --- a/src/jobflow/core/job.py +++ b/src/jobflow/core/job.py @@ -634,7 +634,7 @@ def run(self, store: jobflow.JobStore) -> Response: ) from err save = {k: "output" if v is True else v for k, v in self._kwargs.items()} - data = JobStoreDocument( + data: JobStoreDocument = JobStoreDocument( uuid=self.uuid, index=self.index, output=output, diff --git a/src/jobflow/schemas/job_output_schema.py b/src/jobflow/schemas/job_output_schema.py index 6fb8ddc7..6f7cf273 100644 --- a/src/jobflow/schemas/job_output_schema.py +++ b/src/jobflow/schemas/job_output_schema.py @@ -1,11 +1,14 @@ """A Pydantic model for Jobstore document.""" -import typing +from typing import Generic, List, TypeVar -from pydantic import BaseModel, Field +from monty.json import MontyDecoder +from pydantic import BaseModel, Field, validator +T = TypeVar("T") -class JobStoreDocument(BaseModel): + +class JobStoreDocument(BaseModel, Generic[T]): """A Pydantic model for Jobstore document.""" uuid: str = Field( @@ -15,7 +18,7 @@ class JobStoreDocument(BaseModel): None, description="The index of the job (number of times the job has been replaced.", ) - output: typing.Any = Field( + output: T = Field( None, description="This is a reference to the future job outpu.", ) @@ -24,7 +27,7 @@ class JobStoreDocument(BaseModel): None, description="Metadeta information supplied by the user.", ) - hosts: typing.List[str] = Field( + hosts: List[str] = Field( None, description="The list of UUIDs of the hosts containing the job.", ) @@ -32,3 +35,24 @@ class JobStoreDocument(BaseModel): None, description="The name of the job.", ) + + @validator("output", pre=True) + def reserialize_output(cls, v): + """ + Pre-validator for the 'output' field. + + This method checks if the input 'v' is a dictionary with specific keys + ('@module' and '@class'). If these keys are present, it reprocesses + the input dictionary using MontyDecoder to deserialize it. + + Args: + cls (Type[JobStoreDocument]): The class this validator is applied to. + v: The input value to validate. + + Returns + ------- + Any: The validated and potentially deserialized value. + """ + if isinstance(v, dict) and "@module" in v and "@class" in v: + v = MontyDecoder().process_decoded(v) + return v From fa152894ea6ee5bfb04dd82ba01b924efb77bcf0 Mon Sep 17 00:00:00 2001 From: Alex Ganose Date: Thu, 28 Sep 2023 10:14:55 +0100 Subject: [PATCH 10/14] Fix typos --- src/jobflow/schemas/job_output_schema.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/jobflow/schemas/job_output_schema.py b/src/jobflow/schemas/job_output_schema.py index 6f7cf273..ee892c6a 100644 --- a/src/jobflow/schemas/job_output_schema.py +++ b/src/jobflow/schemas/job_output_schema.py @@ -16,11 +16,11 @@ class JobStoreDocument(BaseModel, Generic[T]): ) index: int = Field( None, - description="The index of the job (number of times the job has been replaced.", + description="The index of the job (number of times the job has been replaced).", ) output: T = Field( None, - description="This is a reference to the future job outpu.", + description="This is a reference to the future job output.", ) completed_at: str = Field(None, description="The time the job was completed.") metadata: dict = Field( @@ -45,13 +45,17 @@ def reserialize_output(cls, v): ('@module' and '@class'). If these keys are present, it reprocesses the input dictionary using MontyDecoder to deserialize it. - Args: - cls (Type[JobStoreDocument]): The class this validator is applied to. - v: The input value to validate. + Parameters + ---------- + cls : Type[JobStoreDocument] + The class this validator is applied to. + v : Any + The input value to validate. Returns ------- - Any: The validated and potentially deserialized value. + Any + The validated and potentially deserialized value. """ if isinstance(v, dict) and "@module" in v and "@class" in v: v = MontyDecoder().process_decoded(v) From e78c3f3dc394b7fb65891e566875e7457c245eda Mon Sep 17 00:00:00 2001 From: Hrushikesh Sahasrabuddhe Date: Fri, 29 Sep 2023 13:42:22 -0700 Subject: [PATCH 11/14] added support to pydantic v2 --- src/jobflow/schemas/job_output_schema.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jobflow/schemas/job_output_schema.py b/src/jobflow/schemas/job_output_schema.py index ee892c6a..b061c16f 100644 --- a/src/jobflow/schemas/job_output_schema.py +++ b/src/jobflow/schemas/job_output_schema.py @@ -3,7 +3,7 @@ from typing import Generic, List, TypeVar from monty.json import MontyDecoder -from pydantic import BaseModel, Field, validator +from pydantic import BaseModel, Field, field_validator T = TypeVar("T") @@ -36,7 +36,8 @@ class JobStoreDocument(BaseModel, Generic[T]): description="The name of the job.", ) - @validator("output", pre=True) + @field_validator("output", mode="before") + @classmethod def reserialize_output(cls, v): """ Pre-validator for the 'output' field. From d397c8824e234138ad5b67e7b0f94060105195ee Mon Sep 17 00:00:00 2001 From: Hrushikesh Sahasrabuddhe Date: Fri, 29 Sep 2023 13:48:10 -0700 Subject: [PATCH 12/14] added support to pydantic v1 --- src/jobflow/schemas/job_output_schema.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/jobflow/schemas/job_output_schema.py b/src/jobflow/schemas/job_output_schema.py index b061c16f..ee892c6a 100644 --- a/src/jobflow/schemas/job_output_schema.py +++ b/src/jobflow/schemas/job_output_schema.py @@ -3,7 +3,7 @@ from typing import Generic, List, TypeVar from monty.json import MontyDecoder -from pydantic import BaseModel, Field, field_validator +from pydantic import BaseModel, Field, validator T = TypeVar("T") @@ -36,8 +36,7 @@ class JobStoreDocument(BaseModel, Generic[T]): description="The name of the job.", ) - @field_validator("output", mode="before") - @classmethod + @validator("output", pre=True) def reserialize_output(cls, v): """ Pre-validator for the 'output' field. From 03219311ba6043840c80b6b7e387af81e721b759 Mon Sep 17 00:00:00 2001 From: Hrushikesh Sahasrabuddhe Date: Fri, 29 Sep 2023 13:49:49 -0700 Subject: [PATCH 13/14] added support to pydantic v2 --- src/jobflow/schemas/job_output_schema.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/jobflow/schemas/job_output_schema.py b/src/jobflow/schemas/job_output_schema.py index ee892c6a..b061c16f 100644 --- a/src/jobflow/schemas/job_output_schema.py +++ b/src/jobflow/schemas/job_output_schema.py @@ -3,7 +3,7 @@ from typing import Generic, List, TypeVar from monty.json import MontyDecoder -from pydantic import BaseModel, Field, validator +from pydantic import BaseModel, Field, field_validator T = TypeVar("T") @@ -36,7 +36,8 @@ class JobStoreDocument(BaseModel, Generic[T]): description="The name of the job.", ) - @validator("output", pre=True) + @field_validator("output", mode="before") + @classmethod def reserialize_output(cls, v): """ Pre-validator for the 'output' field. From f40c16f11c0cd5123fb456a6a503af398149e696 Mon Sep 17 00:00:00 2001 From: Hrushikesh Sahasrabuddhe Date: Fri, 29 Sep 2023 14:07:20 -0700 Subject: [PATCH 14/14] update docstrings --- src/jobflow/core/job.py | 1 - src/jobflow/core/store.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/jobflow/core/job.py b/src/jobflow/core/job.py index 8f1dbea2..c6dc1fe5 100644 --- a/src/jobflow/core/job.py +++ b/src/jobflow/core/job.py @@ -643,7 +643,6 @@ def run(self, store: jobflow.JobStore) -> Response: hosts=self.hosts, name=self.name, ) - # Need to do changes to .update method store.update(data, key=["uuid", "index"], save=save) CURRENT_JOB.reset() diff --git a/src/jobflow/core/store.py b/src/jobflow/core/store.py index 8968cfad..b2e31574 100644 --- a/src/jobflow/core/store.py +++ b/src/jobflow/core/store.py @@ -265,7 +265,7 @@ def update( Parameters ---------- docs - The document or list of documents to update. + The Pydantic document or list of Pydantic documents to update. key Field name(s) to determine uniqueness for a document, can be a list of multiple fields, a single field, or None if the Store's key field is to