data_algebra/test_util.py
def formats_to_self(ops) -> bool:
    """
    Check a operator dag formats and parses back to itself.
    Can raise exceptions. Also checks pickling.

    :param ops: data_algebra.data_ops.ViewRepresentation
    :return: logical, True if formats and evals back to self
    """
    str1 = repr(ops)
    ops2 = eval(
        str1,
        globals(),
        {
            "pd": data_algebra.default_data_model.pd
        },  # make our definition of pandas available
    )
    str2 = repr(ops2)
    strings_match = str1 == str2  # probably too strict
    ops_match = ops == ops2
    assert ops_match
    if strings_match and (not ops_match):
        raise Exception("strings match, but ops did not")
    pickle_string = pickle.dumps(ops)
    ops_3 = pickle.loads(pickle_string)
    assert ops == ops_3
    return ops_match

    Check a operator dag formats and parses back to itself.
    Can raise exceptions. Also checks pickling.

    :param ops: data_algebra.data_ops.ViewRepresentation
    :return: logical, True if formats and evals back to self
    
Check a operator dag formats and parses back to itself.
Can raise exceptions. Also checks pickling.
Check a operator dag formats and parses back to itself . Can raise exceptions . Also checks pickling .
def formats_to_self(ops) -> bool:
    str1 = repr(ops)
    ops2 = eval(
        str1,
        globals(),
        {
            "pd": data_algebra.default_data_model.pd
        },  
    )
    str2 = repr(ops2)
    strings_match = str1 == str2  
    ops_match = ops == ops2
    assert ops_match
    if strings_match and (not ops_match):
        raise Exception("strings match, but ops did not")
    pickle_string = pickle.dumps(ops)
    ops_3 = pickle.loads(pickle_string)
    assert ops == ops_3
    return ops_match
def formats_to_self ( ops ) -> bool : str1 = repr ( ops ) ops2 = eval ( str1 , globals ( ) , { "pd" : data_algebra . default_data_model . pd } , ) str2 = repr ( ops2 ) strings_match = str1 == str2 ops_match = ops == ops2 assert ops_match if strings_match and ( not ops_match ) : raise Exception ( "strings match, but ops did not" ) pickle_string = pickle . dumps ( ops ) ops_3 = pickle . loads ( pickle_string ) assert ops == ops_3 return ops_match
Check a operator dag formats and parses back to itself.
Check a operator dag formats and parses back to itself .
"""
    Check a operator dag formats and parses back to itself.
    Can raise exceptions. Also checks pickling.

    :param ops: data_algebra.data_ops.ViewRepresentation
    :return: logical, True if formats and evals back to self
    """ # make our definition of pandas available # probably too strict
logical, True if formats and evals back to self
logical True if formats and evals back to self
ops
None