Repository navigation
fix(autogen-ext): collect required packages from every pip install line - #8445
Open
电大老baby (HhH666-ux) wants to merge 1 commit into
Open
电大老baby (HhH666-ux) wants to merge 1 commit into
电大老baby (HhH666-ux) wants to merge 1 commit into
Conversation
get_required_packages assigned to the result set inside the loop, so only the packages of the last '!pip install' line survived. The Azure container code executor relies on this function to gate execution on package availability, which let blocks with multiple install lines run with missing packages and fail at import time. Accumulate with set.update, strip all surrounding whitespace from each requirement, and skip empty entries. Fixes microsoft#8444
This branch has not been deployed
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.
Description
Fixes #8444.
get_required_packages()walked every!pip installline of a code block but assigned to the result set inside the loop (ret = {...}), so only the packages from the last matching line survived.AzureContainerCodeExecutoruses this function to gate execution on package availability (_azure_container_code_executor.py:451-457), so a block likeonly checked
pandasagainst the environment: a missingnumpypassed the gate and the code failed inside the container withModuleNotFoundErrorinstead of the intended "Python packages unavailable in environment: {numpy}" message.Changes
ret.update(...).-qqqflag (copied fromsilence_pip) now describes what the function actually does.Testing
Also verified end to end with the repro from #8444: the function now returns
{'numpy', 'pandas', 'requests'}for a three-line install block.