File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -466,6 +466,13 @@ def test_table_exist(ctx):
466466 assert ctx .table_exist ("t" ) is True
467467
468468
469+ def test_table_not_found (ctx ):
470+ from uuid import uuid4
471+
472+ with pytest .raises (KeyError ):
473+ ctx .table (f"not-found-{ uuid4 ()} " )
474+
475+
469476def test_read_json (ctx ):
470477 path = os .path .dirname (os .path .abspath (__file__ ))
471478
Original file line number Diff line number Diff line change @@ -765,7 +765,8 @@ impl PySessionContext {
765765 }
766766
767767 pub fn table ( & self , name : & str , py : Python ) -> PyResult < PyDataFrame > {
768- let x = wait_for_future ( py, self . ctx . table ( name) ) . map_err ( DataFusionError :: from) ?;
768+ let x = wait_for_future ( py, self . ctx . table ( name) )
769+ . map_err ( |e| PyKeyError :: new_err ( e. to_string ( ) ) ) ?;
769770 Ok ( PyDataFrame :: new ( x) )
770771 }
771772
You can’t perform that action at this time.
0 commit comments