Skip to content

Commit

Permalink
apply in _create_from_matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Apr 11, 2024
1 parent dd6f2eb commit 70e2dd9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions apis/python/src/tiledbsoma/io/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1293,10 +1293,6 @@ def _create_from_matrix(
logging.log_io(None, f"START WRITING {uri}")

try:
soma_ndarray = cls.open(
uri, "w", platform_config=platform_config, context=context
)
except DoesNotExistError:
# A SparseNDArray must be appendable in soma.io.
shape = [None for _ in matrix.shape] if cls.is_sparse else matrix.shape
soma_ndarray = cls.create(
Expand All @@ -1306,9 +1302,12 @@ def _create_from_matrix(
platform_config=platform_config,
context=context,
)
else:
except AlreadyExistsError:
if ingestion_params.error_if_already_exists:
raise SOMAError(f"{soma_ndarray.uri} already exists")
soma_ndarray = cls.open(
uri, "w", platform_config=platform_config, context=context
)

if ingestion_params.write_schema_no_data:
logging.log_io(
Expand Down

0 comments on commit 70e2dd9

Please sign in to comment.