fix: resolve mutable defaults, narrow exception handling, and sys.modules leak - #33
Merged
Merged
Conversation
…ules leak - Replace mutable list defaults in DatasetUploader.__init__ with None sentinels to avoid shared-state bugs (B006) - Narrow exception catch in uploader skip/append paths from bare Exception to ValueError, matching Phoenix's actual not-found exception; non-recoverable errors now propagate correctly - Clean up sys.modules on exec_module failure in runner._load_attribute to prevent partially-initialized modules from leaking - Improve contains evaluator docstring to clarify single-item behavior - Add regression tests for exception propagation and sys.modules cleanup
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.
listdefaults inDatasetUploader.__init__withNonesentinels to prevent shared-state bugs (B006)except Exceptiontoexcept ValueErrorin uploader skip/append paths, matching Phoenix's actual not-found exception; non-recoverable errors (network, auth) now propagate correctlysys.modulesleak — Clean up partially-initialized modules fromsys.moduleswhenexec_modulefails inrunner._load_attributecontainsevaluator docs — Add prominent note clarifying that only the first expected item is checkedTests
test_non_not_found_error_propagatesto verifyRuntimeErrorfrom Phoenix is not swallowedtest_cleans_sys_modules_on_import_errorto verify broken modules are removed fromsys.modulesValueErrorinstead of genericExceptionfor not-found scenariosFiles changed
src/evalwire/uploader.pysrc/evalwire/runner.pysys.modulescleanup on import failuresrc/evalwire/evaluators/contains.pytests/test_uploader.pytests/test_runner.pysys.modulescleanup testtests/test_cli.py