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-8abc085471b6e8b8c19df0c1d37bb87b4c89624b in repository https://gitbox.apache.org/repos/asf/datafusion.git
commit d248047b6484e6e0c712dfc6be4f70d618735372 Author: Pepijn Van Eeckhoudt <[email protected]> AuthorDate: Thu Jul 23 20:08:08 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]
