Skip to content

feat: add Task Result API support with example and unit tests#156

Merged
isivaselvan merged 7 commits into
next-1.0.0from
feature/task-result-api
May 22, 2026
Merged

feat: add Task Result API support with example and unit tests#156
isivaselvan merged 7 commits into
next-1.0.0from
feature/task-result-api

Conversation

@TanyaSingh369-svg

@TanyaSingh369-svg TanyaSingh369-svg commented May 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for the Task Result API in the Python SDK.

This enables retrieving run task results via task_result_id, including full model representation, resource integration, and example usage.

Changes

  • Added TaskResult model with all relevant fields and enums
  • Added TaskResults resource with read method
  • Updated client to expose task_results API
  • Updated task stage model to include task result relationship
  • Added example (examples/task_result.py) demonstrating usage with task_result_id
  • Added unit tests for task result functionality

Testing

  • Verified using real task_result_id values retrieved via:
    GET /runs/{run_id}/task-stages
  • Confirmed correct parsing of API response into model
  • Unit tests added to validate functionality

Validation

Unit Test

python -m pytest tests/units/test_task_results.py -v

Result:
All tests passed successfully

Screenshot 2026-05-13 at 1 40 50 AM

Example Execution

export TFE_TASK_RESULT_ID=<task_result_id>
PYTHONPATH=. python examples/task_result.py

Result:
- Successfully retrieved and displayed Task Result from API
- Verified correct parsing of response into SDK model

Screenshot 2026-05-20 at 2 36 41 PM

@TanyaSingh369-svg TanyaSingh369-svg requested a review from a team as a code owner May 12, 2026 15:49
Comment thread src/pytfe/resources/task_result.py
Comment thread src/pytfe/models/task_result.py Outdated
Comment thread src/pytfe/resources/task_result.py Outdated
Comment thread src/pytfe/models/task_result.py
@isivaselvan isivaselvan merged commit 17fe314 into next-1.0.0 May 22, 2026
11 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.

2 participants