Skip to content

Commit def094a

Browse files
committed
Add Documentation To Clarify The full_domain Logic
1 parent 623eb32 commit def094a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tiledb/dataframe_.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,11 +480,18 @@ def _from_pandas(uri, dataframe, tiledb_args):
480480
elif mode != "ingest":
481481
raise TileDBError(f"Invalid mode specified ('{mode}')")
482482

483-
# TODO: disentangle the full_domain logic
484483
full_domain = tiledb_args.get("full_domain", False)
484+
485485
if sparse == False and (not index_dims or "index_col" not in tiledb_args):
486+
# for dense arrays, if there aren't any columns specified to use in
487+
# creating the dimension (via `index_dims` or the Pandas `read_csv`
488+
# argument `index_col`), then use the full domain
486489
full_domain = True
490+
487491
if full_domain is None and tiledb_args.get("nrows"):
492+
# Pandas `read_csv` argument `nrows` specifies to only read the first n
493+
# rows of a CSV file resulting in a dimension that should have a domain
494+
# length of n, not the full domain
488495
full_domain = False
489496

490497
date_spec = tiledb_args.get("date_spec")

tiledb/tests/test_pandas_dataframe.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from curses import A_ATTRIBUTES
21
import pytest
32

43
pd = pytest.importorskip("pandas")

0 commit comments

Comments
 (0)