quantdata.utils.testing#

Utility functions for testing Data Frames#

quantdata.utils.testing.assert_pl_frame_equal(actual, expected, *, sort_by=None, check_dtypes=True, check_column_order=True, check_exact=False, rel_tol=1e-10, abs_tol=1e-12)[source]#

Assert that two Polars DataFrames are equal, with options for sorting and tolerance.

quantdata.utils.testing.assert_pd_frame_equal(actual, expected, *, sort_by=None, reset_index=True, check_dtype=True, check_exact=False, rtol=1e-10, atol=1e-12)[source]#

Assert that two Pandas DataFrames are equal, with options for sorting and tolerance.

quantdata.utils.testing.hash_pandas_df(df, *, include_index=True, include_schema=True, digest_size=16)[source]#

Compute a hash of a pandas DataFrame, including its data and optionally its schema and index.

quantdata.utils.testing.hash_polars_df(df, *, include_schema=True, digest_size=16)[source]#

Compute a hash of a Polars DataFrame, including its data and optionally its schema.