File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ use datafusion::datasource::TableProvider;
2222use datafusion_ffi:: table_provider:: { FFI_TableProvider , ForeignTableProvider } ;
2323use pyo3:: exceptions:: PyDeprecationWarning ;
2424use pyo3:: prelude:: * ;
25- use pyo3:: types:: PyCapsule ;
25+ use pyo3:: types:: { PyCapsule , PyDict } ;
2626
2727use crate :: catalog:: PyTable ;
2828use crate :: dataframe:: PyDataFrame ;
@@ -90,12 +90,15 @@ impl PyTableProvider {
9090 /// `TableProvider.from_dataframe` instead.
9191 #[ staticmethod]
9292 pub fn from_view ( py : Python < ' _ > , df : & PyDataFrame ) -> PyDataFusionResult < Self > {
93- py. import ( "warnings" ) ?. call_method1 (
93+ let kwargs = PyDict :: new ( py) ;
94+ kwargs. set_item ( "stacklevel" , 2 ) ?;
95+ py. import ( "warnings" ) ?. call_method (
9496 "warn" ,
9597 (
9698 "PyTableProvider.from_view() is deprecated; use DataFrame.into_view() or TableProvider.from_dataframe() instead." ,
9799 py. get_type :: < PyDeprecationWarning > ( ) ,
98100 ) ,
101+ Some ( & kwargs) ,
99102 ) ?;
100103 Ok ( Self :: from_dataframe ( df) )
101104 }
You can’t perform that action at this time.
0 commit comments