Skip to content

Commit 85f0a30

Browse files
p4perf4ceihnorton
authored andcommitted
fix: Add context manager before enter .array_exists
1 parent c1db81c commit 85f0a30

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tiledb/dataframe_.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,8 +865,9 @@ def from_csv(uri: str, csv_file: Union[str, List[str]], **kwargs):
865865
elif mode not in ["ingest", "append"]:
866866
raise tiledb.TileDBError("Invalid mode specified ('{}')".format(mode))
867867

868-
if mode != "append" and tiledb.array_exists(uri):
869-
raise tiledb.TileDBError("Array URI '{}' already exists!".format(uri))
868+
with tiledb.scope_ctx(ctx):
869+
if mode != "append" and tiledb.array_exists(uri):
870+
raise tiledb.TileDBError("Array URI '{}' already exists!".format(uri))
870871

871872
# this is a pandas pass-through argument, do not pop!
872873
chunksize = kwargs.get("chunksize", None)

0 commit comments

Comments
 (0)