alamb commented on code in PR #13690:
URL: https://github.com/apache/datafusion/pull/13690#discussion_r1874950076


##########
datafusion/core/src/datasource/dynamic_file.rs:
##########
@@ -55,33 +55,42 @@ impl UrlTableFactory for DynamicListTableFactory {
             return Ok(None);
         };
 
-        let state = &self
+        let session = self
             .session_store()
             .get_session()
             .upgrade()
-            .and_then(|session| {
-                session
-                    .read()
-                    .as_any()
-                    .downcast_ref::<SessionState>()
-                    .cloned()
-            })
             .ok_or_else(|| plan_datafusion_err!("get current SessionStore 
error"))?;
 
-        match ListingTableConfig::new(table_url.clone())
-            .infer_options(state)
+        let runtime_env = Arc::clone(&session.read().runtime_env());
+
+        let Some(state) = session
+            .read()
+            .as_any()
+            .downcast_ref::<SessionState>()
+            .cloned()
+        else {
+            return internal_err!("Expected SessionState, got something else");
+        };
+
+        // Do remove catalog operations on a different runtime
+        runtime_env

Review Comment:
   This shows how annotating the I/O call sites in DataFusion would look like 
(calling `spawn_io` internally)
   
   This call could be converted easily because it doesn't pass in `&self` or 
capture any fields



-- 
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

Reply via email to