Skip to content

Commit

Permalink
add test_parquet_reader_columns
Browse files Browse the repository at this point in the history
  • Loading branch information
troyraen committed May 20, 2024
1 parent ade16d2 commit d4acbfe
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/hipscat_import/catalog/test_file_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,19 @@ def test_parquet_reader_provenance_info(tmp_path, basic_catalog_info):
io.write_provenance_info(catalog_base_dir, basic_catalog_info, provenance_info)


def test_parquet_reader_columns(parquet_shards_shard_44_0):
"""Verify we can read a subset of columns."""
column_subset = ["id", "dec"]

# test column_names class property
for frame in ParquetReader(column_names=column_subset).read(parquet_shards_shard_44_0):
assert set(frame.columns) == set(column_subset)

# test read_columns kwarg
for frame in ParquetReader().read(parquet_shards_shard_44_0, read_columns=column_subset):
assert set(frame.columns) == set(column_subset)


def test_read_fits(formats_fits):
"""Success case - fits file that exists being read as fits"""
total_chunks = 0
Expand Down

0 comments on commit d4acbfe

Please sign in to comment.