mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-07-07 09:02:59 +00:00

### 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)
27 lines
682 B
Python
Executable File
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()
|