def test_resolve_hidden_name(): define_alias("jets", "pt", lambda j: j.pt / 1000.0) df = DataFrame() df = df.jets r = lookup_alias(df, "pt") assert r is not None df1 = r.apply(df) assert df1.child_expr is not None t = ast.dump(df1.child_expr) assert '1000' in t
def test_resolve_two_names_good_2(): define_alias("jets", "pts", lambda j: j.pt / 1000.0) define_alias("eles", "pts", lambda j: j.pt / 2000.0) df = DataFrame() df = df.eles r = lookup_alias(df, "pts") assert r is not None df1 = r.apply(df) assert df1.child_expr is not None t = ast.dump(df1.child_expr) assert '2000' in t
def test_resolve_partial_wildcard_nogood_1(): define_alias("jets", "pts", lambda j: j.pt / 1000.0) df = DataFrame() df = df.eles r = lookup_alias(df, "pts") assert r is None
def test_resolve_wilecard_nogood(): define_alias("", "pts", lambda j: j.pt / 1000.0) df = DataFrame() r = lookup_alias(df, "pt") assert r is None
def test_resolve_wilecard_good_1(): define_alias("", "pts", lambda j: j.pt / 1000.0) df = DataFrame() df = df.jets r = lookup_alias(df, "pts") assert r is not None
def test_resolve_well_specified_nogood_3(): define_alias(".jets", "pts", lambda j: j.pt / 1000.0) df = DataFrame() df = df.eles r = lookup_alias(df, "pts") assert r is None
def test_resolve_root_good(): define_alias(".", "pts", lambda j: j.pt / 1000.0) df = DataFrame() df = df r = lookup_alias(df, "pts") assert r is not None