Skip to content

Commit

Permalink
[python] Domain-at-create unit-test PR 2/N (#3190)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl authored Oct 18, 2024
1 parent 7336955 commit fc5b7bb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
21 changes: 13 additions & 8 deletions apis/python/tests/test_type_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,21 @@ def test_bool_arrays(tmp_path, bool_array):
]
)
index_column_names = ["soma_joinid"]

n_data = len(bool_array)
data = {
"soma_joinid": list(range(n_data)),
"b": bool_array,
}
rb = pa.Table.from_pydict(data)
nrb = len(rb)

with soma.DataFrame.create(
tmp_path.as_posix(), schema=schema, index_column_names=index_column_names
tmp_path.as_posix(),
schema=schema,
index_column_names=index_column_names,
domain=[[0, max(nrb, 1) - 1]],
) as sdf:
n_data = len(bool_array)

data = {
"soma_joinid": list(range(n_data)),
"b": bool_array,
}
rb = pa.Table.from_pydict(data)
sdf.write(rb)

with soma.DataFrame.open(tmp_path.as_posix()) as sdf:
Expand Down
1 change: 1 addition & 0 deletions apis/python/tests/test_unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def sample_dataframe_path(tmp_path, sample_arrow_table):
tmp_path.as_posix(),
schema=sample_arrow_table.schema,
index_column_names=["soma_joinid"],
domain=((0, len(sample_arrow_table) - 1),),
) as sdf:
sdf.write(sample_arrow_table)
return sdf.uri
Expand Down

0 comments on commit fc5b7bb

Please sign in to comment.