kosiew commented on code in PR #1016: URL: https://github.com/apache/datafusion-python/pull/1016#discussion_r1984416193
########## src/dataframe.rs: ########## @@ -50,6 +52,22 @@ use crate::{ expr::{sort_expr::PySortExpr, PyExpr}, }; +#[pyclass(name = "TableProvider", module = "datafusion")] +pub struct PyTableProvider { + provider: Arc<dyn TableProvider>, +} + +impl PyTableProvider { + pub fn new(provider: Arc<dyn TableProvider>) -> Self { + Self { provider } + } + + pub fn as_table(&self) -> PyTable { + let table_provider: Arc<dyn TableProvider> = self.provider.clone(); + PyTable::new(table_provider) + } +} + Review Comment: > skip the whole creating a view as a table provider and instead go straight to registering a view on the session context? Sounds good. Implemented. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org