@@ -53,12 +53,23 @@ def test_fetch_as_dict_true(self, mock_expression):
5353
5454 mock_expression .to_dicts .assert_called_once_with (order_by = None , limit = None , offset = None , squeeze = False )
5555
56- def test_fetch_with_attrs_returns_dicts (self , mock_expression ):
57- """fetch('col1', 'col2') should call proj().to_dicts() ."""
56+ def test_fetch_with_attrs_returns_arrays (self , mock_expression ):
57+ """fetch('col1', 'col2') should call to_arrays() - matches DJ 1.x behavior ."""
5858 with warnings .catch_warnings ():
5959 warnings .simplefilter ("ignore" , DeprecationWarning )
6060 mock_expression .fetch ("col1" , "col2" )
6161
62+ # DJ 1.x: fetch('col') returns array(['alpha', 'beta']), not list of dicts
63+ mock_expression .to_arrays .assert_called_once_with (
64+ "col1" , "col2" , order_by = None , limit = None , offset = None , squeeze = False
65+ )
66+
67+ def test_fetch_with_attrs_as_dict_true (self , mock_expression ):
68+ """fetch('col1', 'col2', as_dict=True) should call proj().to_dicts()."""
69+ with warnings .catch_warnings ():
70+ warnings .simplefilter ("ignore" , DeprecationWarning )
71+ mock_expression .fetch ("col1" , "col2" , as_dict = True )
72+
6273 mock_expression .proj .assert_called_once_with ("col1" , "col2" )
6374 mock_expression .to_dicts .assert_called_once ()
6475
0 commit comments