[PR #57] [MERGED] Fix generic typing in Context object #81

Closed
opened 2026-02-16 02:16:31 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/workflows-py/pull/57
Author: @masci
Created: 8/7/2025
Status: Merged
Merged: 8/7/2025
Merged by: @masci

Base: mainHead: massi/ctx-typing


📝 Commits (3)

📊 Changes

7 files changed (+24 additions, -11 deletions)

View changed files

📝 .github/workflows/lint.yml (+3 -1)
📝 .pre-commit-config.yaml (+5 -1)
📝 pyproject.toml (+3 -0)
📝 src/workflows/context/context.py (+4 -3)
📝 tests/test_state_manager.py (+4 -3)
📝 tests/test_streaming.py (+2 -2)
📝 tests/test_workflow_typed_state.py (+3 -1)

📄 Description

Added proper cast to address the fact that MODEL_T is invariant but it's used interchangeably in Context[MODEL_T] and InMemoryStateStore[MODEL_T] causing pyright to fail understanding the type of _state_store.

Also added basedpyright to pre-commit, mypy didn't catch this.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/workflows-py/pull/57 **Author:** [@masci](https://github.com/masci) **Created:** 8/7/2025 **Status:** ✅ Merged **Merged:** 8/7/2025 **Merged by:** [@masci](https://github.com/masci) **Base:** `main` ← **Head:** `massi/ctx-typing` --- ### 📝 Commits (3) - [`490d167`](https://github.com/run-llama/workflows-py/commit/490d1679bb5a4fcf358506ffd20d07d6396ddae4) add basedpyright - [`416a591`](https://github.com/run-llama/workflows-py/commit/416a591a47672c4b67f1fbd5a46b5acb1626cb3e) fix generic typing - [`5d7791a`](https://github.com/run-llama/workflows-py/commit/5d7791ac74f9552052d9357e3c63a62173ef7e1d) sync all extras before running pre-commit ### 📊 Changes **7 files changed** (+24 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/lint.yml` (+3 -1) 📝 `.pre-commit-config.yaml` (+5 -1) 📝 `pyproject.toml` (+3 -0) 📝 `src/workflows/context/context.py` (+4 -3) 📝 `tests/test_state_manager.py` (+4 -3) 📝 `tests/test_streaming.py` (+2 -2) 📝 `tests/test_workflow_typed_state.py` (+3 -1) </details> ### 📄 Description Added proper `cast` to address the fact that `MODEL_T` is invariant but it's used interchangeably in `Context[MODEL_T]` and `InMemoryStateStore[MODEL_T]` causing pyright to fail understanding the type of `_state_store`. Also added basedpyright to pre-commit, mypy didn't catch this. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 02:16:31 -05:00
yindo closed this issue 2026-02-16 02:16:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/workflows-py#81