Skip to content

add function#143

Merged
ryanraaschCDC merged 12 commits intomainfrom
rr-142-task-status
Mar 26, 2026
Merged

add function#143
ryanraaschCDC merged 12 commits intomainfrom
rr-142-task-status

Conversation

@ryanraaschCDC
Copy link
Copy Markdown
Collaborator

No description provided.

@ryanraaschCDC ryanraaschCDC linked an issue Mar 26, 2026 that may be closed by this pull request
@ryanraaschCDC ryanraaschCDC requested a review from Copilot March 26, 2026 14:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new helper and client API to retrieve Azure Batch task status information for a job (optionally scoped to a single task), making it accessible via CloudClient.

Changes:

  • Added get_task_status() helper in cfa/cloudops/batch_helpers.py.
  • Added CloudClient.get_task_status() wrapper in cfa/cloudops/_cloudclient.py.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.

File Description
cfa/cloudops/batch_helpers.py Introduces get_task_status() and imports json to serialize task status output.
cfa/cloudops/_cloudclient.py Exposes get_task_status() via CloudClient with a docstring and typed signature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ryanraaschCDC and others added 5 commits March 26, 2026 14:38
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1702 to +1706
{
"id": task.id,
"state": task.state.value,
"exit_code": task.execution_info.exit_code,
}
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using task.state.value is inconsistent with the rest of this module, which generally treats SDK state fields as string-like values (e.g., get_job_state returns str(job.state) and task comparisons use task.state == batch_models.TaskState.completed). Prefer normalizing via str(task.state) (or otherwise handling both string and Enum cases) so this function doesn't rely on a .value attribute.

Copilot uses AI. Check for mistakes.
@ryanraaschCDC ryanraaschCDC requested a review from xop5 March 26, 2026 18:09
@ryanraaschCDC ryanraaschCDC self-assigned this Mar 26, 2026
Use getattr to handle missing execution_info for active tasks
Safely fallback to string parsing when task.state is not an Enum
Add tests for string-based pre-execution task states
fix: safely parse task state and execution info in get_task_status
Copy link
Copy Markdown
Collaborator

@cdc-as81 cdc-as81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ryanraaschCDC ryanraaschCDC marked this pull request as ready for review March 26, 2026 19:15
@ryanraaschCDC ryanraaschCDC merged commit c7e5150 into main Mar 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

function for current task status

4 participants