unstructured/test_unstructured_ingest/python/test-ingest-delta-table-output.py
Roman Isecke d09c8c0cab
test: update ingest dest tests to follow set pattern (#1991)
### Description
Update all destination tests to match pattern:
* Don't omit any metadata to check full schema
* Move azure cognitive dest test from src to dest
* Split delta table test into seperate src and dest tests
* Fix azure cognitive search and add to dest tests being run (wasn't
being run originally)
2023-11-03 12:46:56 +00:00

27 lines
682 B
Python
Executable File

import click
from deltalake import DeltaTable
@click.command()
@click.option("--table-uri", type=str)
def run_check(table_uri):
print(f"Checking contents of table at {table_uri}")
delta_table = DeltaTable(
table_uri=table_uri,
)
expected_rows = 5
found_rows = len(delta_table.to_pandas())
print(
f"Checking if expected number of rows ({expected_rows}) "
f"matches how many were found: {found_rows}"
)
assert (
expected_rows == found_rows
), f"expected number of rows doesn't match how many were found: {expected_rows}/{found_rows}"
print("table check complete")
if __name__ == "__main__":
run_check()