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):
466
466
assert ctx .table_exist ("t" ) is True
467
467
468
468
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
+
469
476
def test_read_json (ctx ):
470
477
path = os .path .dirname (os .path .abspath (__file__ ))
471
478
Original file line number Diff line number Diff line change @@ -765,7 +765,8 @@ impl PySessionContext {
765
765
}
766
766
767
767
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 ( ) ) ) ?;
769
770
Ok ( PyDataFrame :: new ( x) )
770
771
}
771
772
You can’t perform that action at this time.
0 commit comments