Skip to content

Commit

Permalink
remove unused is_job_result field (#472)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
skshetry and pre-commit-ci[bot] authored Sep 24, 2024
1 parent 6d91459 commit 845aaa2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
3 changes: 0 additions & 3 deletions src/datachain/catalog/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
)

Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/datachain/data_storage/metastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down Expand Up @@ -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"),
]

Expand Down Expand Up @@ -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."""
Expand All @@ -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',
Expand Down
5 changes: 0 additions & 5 deletions src/datachain/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -221,7 +219,6 @@ def parse( # noqa: PLR0913
sources,
query_script,
job_id,
is_job_result,
)

def __eq__(self, other):
Expand Down Expand Up @@ -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 {}
Expand All @@ -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(
Expand Down

0 comments on commit 845aaa2

Please sign in to comment.