From d573b40a7daea5306a6614b834ffb873ea967536 Mon Sep 17 00:00:00 2001 From: Konstantinos Tsitsimpikos Date: Thu, 15 Feb 2024 10:45:05 +0200 Subject: [PATCH] Adding as_batch wrapper for the UDF call of ingestor (#515) --- src/tiledb/cloud/bioimg/ingestion.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/tiledb/cloud/bioimg/ingestion.py b/src/tiledb/cloud/bioimg/ingestion.py index e38ca45c6..35d046a6e 100644 --- a/src/tiledb/cloud/bioimg/ingestion.py +++ b/src/tiledb/cloud/bioimg/ingestion.py @@ -1,5 +1,5 @@ import logging -from typing import Any, Dict, Iterator, Mapping, Optional, Sequence, Tuple, Union +from typing import Any, Iterator, Mapping, Optional, Sequence, Tuple, Union import tiledb from tiledb.cloud import dag @@ -8,6 +8,7 @@ from tiledb.cloud.bioimg.helpers import validate_io_paths from tiledb.cloud.dag.mode import Mode from tiledb.cloud.rest_api.models import RetryStrategy +from tiledb.cloud.utilities._common import as_batch from tiledb.cloud.utilities._common import run_dag DEFAULT_RESOURCES = {"cpu": "8", "memory": "4Gi"} @@ -351,7 +352,5 @@ def register_dataset_udf( return graph -def ingest_udf(*args: Any, **kwargs: Any) -> Dict[str, str]: - """Ingestor wrapper function that can be used as a UDF.""" - grf = ingest(*args, **kwargs) - return {"status": "started", "graph_id": str(grf.server_graph_uuid)} +# Wrapper function for batch VCF ingestion +ingest = as_batch(ingest)