Skip to content

Commit

Permalink
Adding as_batch wrapper for the UDF call of ingestor (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsitsi authored Feb 15, 2024
1 parent ea3276f commit d573b40
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/tiledb/cloud/bioimg/ingestion.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"}
Expand Down Expand Up @@ -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)

0 comments on commit d573b40

Please sign in to comment.