feat: add Task Result API support with example and unit tests#156
Open
TanyaSingh369-svg wants to merge 3 commits into
Open
feat: add Task Result API support with example and unit tests#156TanyaSingh369-svg wants to merge 3 commits into
TanyaSingh369-svg wants to merge 3 commits into
Conversation
isivaselvan
reviewed
May 14, 2026
|
|
||
| return self._parse_task_result(data["data"]) | ||
|
|
||
| def _parse_task_result(self, data: dict[str, Any]) -> TaskResult: |
Collaborator
There was a problem hiding this comment.
task stage relation was not mapped to the read output and the response shows None
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
TaskResultmodel with all relevant fields and enumsTaskResultsresource withreadmethodtask_resultsAPIexamples/task_result.py) demonstrating usage withtask_result_idTesting
task_result_idvalues retrieved via:GET /runs/{run_id}/task-stages
Validation
Unit Test
python -m pytest tests/units/test_task_results.py -v
Result:
All tests passed successfully
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