Skip to content

Commit

Permalink
Fix RDataFrame GetColumnNames order in test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpivarski committed May 2, 2022
1 parent edb2ff2 commit 4d2b9a6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/v2/test_1374-to-rdataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_two_columns_as_rvecs():
data_frame = ak._v2.operations.convert.to_rdataframe(
{"x": ak_array_1, "y": ak_array_2}, flatlist_as_rvec=True
)
assert list(data_frame.GetColumnNames()) == ["x", "y"]
assert set(data_frame.GetColumnNames()) == {"x", "y"}
assert data_frame.GetColumnType("x") == "double"
assert data_frame.GetColumnType("y").startswith("awkward::Record_")

Expand Down Expand Up @@ -104,7 +104,7 @@ def test_two_columns_as_vecs():
data_frame = ak._v2.operations.convert.to_rdataframe(
{"x": ak_array_1, "y": ak_array_2}, flatlist_as_rvec=False
)
assert list(data_frame.GetColumnNames()) == ["x", "y"]
assert set(data_frame.GetColumnNames()) == {"x", "y"}
assert data_frame.GetColumnType("x") == "double"
assert data_frame.GetColumnType("y").startswith("awkward::Record_")

Expand Down Expand Up @@ -152,7 +152,7 @@ def test_two_columns_transform_filter():
data_frame = ak._v2.operations.convert.to_rdataframe(
{"one": example1, "two": example2}
)
assert list(data_frame.GetColumnNames()) == ["one", "two"]
assert set(data_frame.GetColumnNames()) == {"one", "two"}

compiler(
"""
Expand All @@ -167,7 +167,7 @@ def test_two_columns_transform_filter():
data_frame_transformed = ROOT.MyTransformation[data_frame.GetColumnType("one")](
ROOT.RDF.AsRNode(data_frame)
)
assert list(data_frame_transformed.GetColumnNames()) == ["neg_one", "one", "two"]
assert set(data_frame_transformed.GetColumnNames()) == {"neg_one", "one", "two"}
assert data_frame_transformed.Count().GetValue() == 5

data_frame2 = data_frame.Filter("one > 2.5")
Expand All @@ -180,9 +180,9 @@ def test_two_columns_transform_filter():
def test_jims_example1():
array = ak._v2.Array([{"x": 1.1}, {"x": 2.2}, {"x": 3.3}, {"x": 4.4}, {"x": 5.5}])
data_frame = ak._v2.to_rdataframe({"some_array": array})
assert list(data_frame.GetColumnNames()) == ["some_array"]
assert set(data_frame.GetColumnNames()) == {"some_array"}
data_frame_y = data_frame.Define("y", "some_array.x()")
assert list(data_frame_y.GetColumnNames()) == ["some_array", "y"]
assert set(data_frame_y.GetColumnNames()) == {"some_array", "y"}

cpp_list = ", ".join(str(e) for e in array.x.to_list())

Expand Down

0 comments on commit 4d2b9a6

Please sign in to comment.