mingmwang commented on a change in pull request #1987:
URL: https://github.com/apache/arrow-datafusion/pull/1987#discussion_r825584582
##########
File path: datafusion/src/datasource/file_format/parquet.rs
##########
@@ -419,7 +423,8 @@ mod tests {
#[tokio::test]
async fn read_alltypes_plain_parquet() -> Result<()> {
- let runtime = Arc::new(RuntimeEnv::default());
+ let session_ctx = SessionContext::new();
+ let task_ctx = Arc::new(TaskContext::from(&session_ctx));
Review comment:
> Since this is such a common pattern (create a Arc` I wonder if it
would make sense to create a function for it?
>
> like
>
> ```rust
> impl SessionContext {
> /// Get a new TaskContext to run in this session
> pub fn task_ctx(&self) -> Arc<TaskContext> {
> ...
> }
> }
> ```
Done.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]