fix: resolve Windows stdin select crash and CLI string type coercion …#6
Open
Adityakk9031 wants to merge 2 commits into
Open
fix: resolve Windows stdin select crash and CLI string type coercion …#6Adityakk9031 wants to merge 2 commits into
Adityakk9031 wants to merge 2 commits into
Conversation
Author
|
@jeqcho have a look |
Contributor
|
Two things here. First, formatting is the only test failure: Second, the description says this fixes both the Windows stdin crash and the CLI coercion, but the diff only touches |
Author
|
@jeqcho please review again |
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.
Fixes #5
Summary
Fixes runtime
ValueError,TypeError, and silent boolean inversion errors when configuration options are passed as string key-value pairs (e.g. from Inspect Robots CLI flags like-P port=8000,-E control_hz=15.0,-E unattended=false)._FromKwargs.from_kwargs()previously only parsed_FLOAT_TUPLE_FIELDS. Scalar string arguments were passed as rawstrobjects directly into frozen dataclasses (FrankaConfigandOpenpiConfig), failing type validation inside__post_init__or evaluating"false"as truthy.Proposed Changes
_FromKwargs: Enhanced_FromKwargs.from_kwargs()insrc/inspect_robots_franka/config.pyto inspect dataclass field annotations and parsestrinputs into targetint,float, andbooltypes."true","false","1","0"), ensuring"false"correctly resolves toFalse.test_from_kwargs_parses_string_coercion_types()totests/test_config.py.Verification
python -m pytest -o pythonpath=src --cov=src(102 passed).