This is an automated email from the ASF dual-hosted git repository. github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-23837-ced2492e1a42eb2eede1be5c202285575b648674 in repository https://gitbox.apache.org/repos/asf/datafusion.git
commit 4ea2060ded3be578c09132e7d01bcf37db9aa1d6 Author: Pepijn Van Eeckhoudt <[email protected]> AuthorDate: Thu Jul 23 21:28:22 2026 +0200 Add setter for `TaskContext::task_id` (#23837) ## Which issue does this PR close? Closes #22072 ## Rationale for this change Without a way to set `TaskContext::task_id` the field is a bit pointless. This MR adds a way to set the field. This does not automatically make the field useful for correlation purposes (as hinted at by the linked issue) since it's not filled in anywhere yet, but at least the capability is already there. ## Are these changes tested? Not sure how to meaningfully test this ## Are there any user-facing changes? No --- datafusion/execution/src/task.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/datafusion/execution/src/task.rs b/datafusion/execution/src/task.rs index 18825e1d8d..1c1a717d19 100644 --- a/datafusion/execution/src/task.rs +++ b/datafusion/execution/src/task.rs @@ -52,7 +52,7 @@ use std::{collections::HashMap, sync::Arc}; pub struct TaskContext { /// Session Id session_id: String, - /// Optional Task Identify + /// Optional task identity task_id: Option<String>, /// Session configuration session_config: SessionConfig, @@ -167,6 +167,12 @@ impl TaskContext { self.runtime = runtime; self } + + /// Update the `task_id` + pub fn with_task_id(mut self, task_id: String) -> Self { + self.task_id = Some(task_id); + self + } } impl FunctionRegistry for TaskContext { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
