From 1a2a1d2774a835d1650fb51ab99f3e7d0995990a Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 31 Oct 2024 12:22:32 -0700 Subject: [PATCH] Add a high-level test of `query()`, showing the resolution of #160 --- tests/nested_pandas/nestedframe/test_nestedframe.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/nested_pandas/nestedframe/test_nestedframe.py b/tests/nested_pandas/nestedframe/test_nestedframe.py index fa5da34..151b5f0 100644 --- a/tests/nested_pandas/nestedframe/test_nestedframe.py +++ b/tests/nested_pandas/nestedframe/test_nestedframe.py @@ -447,6 +447,11 @@ def test_query(): # Check for the multi-layer error with pytest.raises(ValueError): base.query("a > 2 & nested.c > 1") + # Create another nest in order to further test the multi-layer error + base_2 = base.eval("nest2.c = nested.c + 1") + assert len(base_2.nested_columns) == 2 + with pytest.raises(ValueError): + base_2.query("nested.c > 1 & nest2.c > 2") # Test nested queries nest_queried = base.query("nested.c > 1")