def check_round_trip(df, engine=None, path=None,<EOL>write_kwargs=None, read_kwargs=None,<EOL>expected=None, check_names=True,<EOL>repeat=<NUM_LIT:2>):
write_kwargs = write_kwargs or {'<STR_LIT>': None}<EOL>read_kwargs = read_kwargs or {}<EOL>if expected is None:<EOL><INDENT>expected = df<EOL><DEDENT>if engine:<EOL><INDENT>write_kwargs['<STR_LIT>'] = engine<EOL>read_kwargs['<STR_LIT>'] = engine<EOL><DEDENT>def compare(repeat):<EOL><INDENT>for _ in range(repeat):<EOL><INDENT>df.to_parquet(path, **write_kwargs)<EOL>with catch_warnings(record=True):<EOL><INDENT>actual = read_parquet(path, **read_kwargs)<EOL><DEDENT>tm.assert_frame_equal(expected, actual,<EOL>check_names=check_names)<EOL><DEDENT><DEDENT>if path is None:<EOL><INDENT>with tm.ensure_clean() as path:<EOL><INDENT>compare(repeat)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>compare(repeat)<EOL><DEDENT>
Verify parquet serializer and deserializer produce the same results.

    Performs a pandas to disk and disk to pandas round trip,
    then compares the 2 resulting DataFrames to verify equality.

    Parameters
    ----------
    df: Dataframe
    engine: str, optional
        'pyarrow' or 'fastparquet'
    path: str, optional
    write_kwargs: dict of str:str, optional
    read_kwargs: dict of str:str, optional
    expected: DataFrame, optional
        Expected deserialization result, otherwise will be equal to `df`
    check_names: list of str, optional
        Closed set of column names to be compared
    repeat: int, optional
        How many times to repeat the test