From 845aaa2205da3d45aa741683520b9e768ed77733 Mon Sep 17 00:00:00 2001 From: skshetry <18718008+skshetry@users.noreply.github.com> Date: Tue, 24 Sep 2024 19:56:36 +0545 Subject: [PATCH] remove unused `is_job_result` field (#472) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/datachain/catalog/catalog.py | 3 --- src/datachain/data_storage/metastore.py | 4 ---- src/datachain/dataset.py | 5 ----- 3 files changed, 12 deletions(-) diff --git a/src/datachain/catalog/catalog.py b/src/datachain/catalog/catalog.py index 33764b538..3e92bd7d1 100644 --- a/src/datachain/catalog/catalog.py +++ b/src/datachain/catalog/catalog.py @@ -979,7 +979,6 @@ def create_new_dataset_version( script_output="", create_rows_table=True, job_id: Optional[str] = None, - is_job_result: bool = False, ) -> DatasetRecord: """ Creates dataset version if it doesn't exist. @@ -1001,7 +1000,6 @@ def create_new_dataset_version( script_output=script_output, schema=schema, job_id=job_id, - is_job_result=is_job_result, ignore_if_exists=True, ) @@ -1211,7 +1209,6 @@ def register_dataset( size=dataset_version.size, preview=dataset_version.preview, job_id=dataset_version.job_id, - is_job_result=dataset_version.is_job_result, ) # to avoid re-creating rows table, we are just renaming it for a new version # of target dataset diff --git a/src/datachain/data_storage/metastore.py b/src/datachain/data_storage/metastore.py index 51335680d..941505f3e 100644 --- a/src/datachain/data_storage/metastore.py +++ b/src/datachain/data_storage/metastore.py @@ -243,7 +243,6 @@ def create_dataset_version( # noqa: PLR0913 size: Optional[int] = None, preview: Optional[list[dict]] = None, job_id: Optional[str] = None, - is_job_result: bool = False, ) -> DatasetRecord: """Creates new dataset version.""" @@ -497,7 +496,6 @@ def _datasets_versions_columns(cls) -> list["SchemaItem"]: Column("query_script", Text, nullable=False, default=""), Column("schema", JSON, nullable=True), Column("job_id", Text, nullable=True), - Column("is_job_result", Boolean, nullable=False, default=False), UniqueConstraint("dataset_id", "version"), ] @@ -1009,7 +1007,6 @@ def create_dataset_version( # noqa: PLR0913 size: Optional[int] = None, preview: Optional[list[dict]] = None, job_id: Optional[str] = None, - is_job_result: bool = False, conn=None, ) -> DatasetRecord: """Creates new dataset version.""" @@ -1035,7 +1032,6 @@ def create_dataset_version( # noqa: PLR0913 size=size, preview=json.dumps(preview or []), job_id=job_id or os.getenv("DATACHAIN_JOB_ID"), - is_job_result=is_job_result, ) if ignore_if_exists and hasattr(query, "on_conflict_do_nothing"): # SQLite and PostgreSQL both support 'on_conflict_do_nothing', diff --git a/src/datachain/dataset.py b/src/datachain/dataset.py index 5bceb4bdb..c6fd04eed 100644 --- a/src/datachain/dataset.py +++ b/src/datachain/dataset.py @@ -179,7 +179,6 @@ class DatasetVersion: sources: str = "" query_script: str = "" job_id: Optional[str] = None - is_job_result: bool = False @classmethod def parse( # noqa: PLR0913 @@ -201,7 +200,6 @@ def parse( # noqa: PLR0913 sources: str = "", query_script: str = "", job_id: Optional[str] = None, - is_job_result: bool = False, ): return cls( id, @@ -221,7 +219,6 @@ def parse( # noqa: PLR0913 sources, query_script, job_id, - is_job_result, ) def __eq__(self, other): @@ -327,7 +324,6 @@ def parse( # noqa: PLR0913 version_query_script: Optional[str], version_schema: str, version_job_id: Optional[str] = None, - version_is_job_result: bool = False, ) -> "DatasetRecord": labels_lst: list[str] = json.loads(labels) if labels else [] schema_dct: dict[str, Any] = json.loads(schema) if schema else {} @@ -353,7 +349,6 @@ def parse( # noqa: PLR0913 version_sources, # type: ignore[arg-type] version_query_script, # type: ignore[arg-type] version_job_id, - version_is_job_result, ) return cls(