pub fn assert_series_equal(
left: &Series,
right: &Series,
options: SeriesEqualOptions,
) -> PolarsResult<()>Expand description
Verifies that two Series are equal according to a set of configurable criteria.
This function serves as the main entry point for comparing Series, checking various metadata properties before comparing the actual values.
§Arguments
left- The first Series to compareright- The second Series to compareoptions- ASeriesEqualOptionsstruct containing configuration parameters:check_names- If true, verifies Series names matchcheck_dtypes- If true, verifies data types matchcheck_order- If true, elements must be in the same ordercheck_exact- If true, requires exact equality for float valuesrel_tol- Relative tolerance for float comparisonabs_tol- Absolute tolerance for float comparisoncategorical_as_str- If true, converts categorical Series to strings before comparison
§Returns
Ok(())if Series match according to all specified criteriaErrwith details about the first mismatch encountered:- Length mismatch
- Name mismatch (if checking names)
- Data type mismatch (if checking dtypes)
- Value mismatches (via
assert_series_values_equal)
§Order of Checks
- Series length
- Series names (if
check_namesis true) - Data types (if
check_dtypesis true) - Series values (delegated to
assert_series_values_equal)