Python: Add redis[asyncio] to requirements.txt for streaming samples#5509
Open
moonbox3 wants to merge 4 commits intomicrosoft:mainfrom
Open
Python: Add redis[asyncio] to requirements.txt for streaming samples#5509moonbox3 wants to merge 4 commits intomicrosoft:mainfrom
redis[asyncio] to requirements.txt for streaming samples#5509moonbox3 wants to merge 4 commits intomicrosoft:mainfrom
Conversation
Both streaming samples import redis.asyncio in redis_stream_response_handler.py but neither included redis in their requirements.txt, causing ModuleNotFoundError on fresh installs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
Contributor
There was a problem hiding this comment.
Pull request overview
Adds the missing Redis client dependency needed by the Python streaming hosting samples so redis.asyncio imports succeed after a fresh install from the sample requirements.txt.
Changes:
- Add a Redis dependency to the two streaming sample
requirements.txtfiles. - Minor formatting-only edits in a couple of Python samples.
- Small cleanup in core tests/init (unused import removal /
__all__ordering tweak).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| python/samples/04-hosting/durabletask/03_single_agent_streaming/requirements.txt | Adds Redis dependency for the durabletask streaming sample. |
| python/samples/04-hosting/azure_functions/03_reliable_streaming/requirements.txt | Adds Redis dependency for the Azure Functions streaming sample. |
| python/samples/04-hosting/a2a/agent_framework_to_a2a.py | Formatting-only change (trailing comma). |
| python/samples/01-get-started/06_functional_workflow_basics.py | Adds blank lines (formatting). |
| python/samples/01-get-started/05_functional_workflow_with_agents.py | Adds blank lines (formatting). |
| python/packages/core/tests/core/test_exceptions.py | Removes unused pytest import. |
| python/packages/core/agent_framework/init.py | Minor reordering within __all__. |
moonbox3
commented
Apr 27, 2026
Contributor
Author
moonbox3
left a comment
There was a problem hiding this comment.
Automated Code Review
Reviewers: 4 | Confidence: 97% | Result: All clear
Reviewed: Correctness, Security Reliability, Test Coverage, Design Approach
Automated review by moonbox3's agents
Revert formatting-only edits in sample files and unrelated cleanup (unused import removal, __all__ reordering) that were accidentally included in the redis dependency fix (issue microsoft#5396). The only intended changes for this PR are the Redis dependency additions to requirements.txt files for the streaming samples. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… redis package missing from requirements.txt in streaming samples
moonbox3
commented
Apr 27, 2026
Contributor
Author
moonbox3
left a comment
There was a problem hiding this comment.
Automated Code Review
Reviewers: 4 | Confidence: 97% | Result: All clear
Reviewed: Correctness, Security Reliability, Test Coverage, Design Approach
Automated review by moonbox3's agents
TaoChenOSU
approved these changes
Apr 27, 2026
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.
Motivation and Context
Two Python streaming samples (
azure_functions/03_reliable_streaminganddurabletask/03_single_agent_streaming) importredis.asyncioin theirredis_stream_response_handler.py, but neither listedredisas a dependency. A freshpip install -r requirements.txtfollowed by running the sample immediately raisedModuleNotFoundError: No module named 'redis'.Fixes #5396
Description
The root cause is that
redis[asyncio]was never included in either sample'srequirements.txt, leaving the import ofredis.asyncio as aioredisunsatisfied at runtime. The fix addsredis[asyncio]to both requirements files so that installing from them provides theredispackage along with its async (hiredis/asyncio) extras, matching what the handler code already requires.Contribution Checklist