Allow --config to load a YAML or JSON file path - #111
Open
NickMortimer wants to merge 2 commits into
Open
Conversation
Inline JSON objects still work, so existing scripts keep running. File contents are loaded with yaml.safe_load; Python is not executed. Co-authored-by: Cursor <cursoragent@cursor.com>
Nested JSON objects exceed NAME_MAX, and Path.is_file() raises ENAMETOOLONG on Python 3.12/3.13 instead of returning False, which broke e2e import tests. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
--configonimport,new pipeline, andnew collectionnow accepts a path to a YAML or JSON file in addition to an inline JSON object string. File contents are loaded withyaml.safe_load(JSON is valid YAML). Python is not executed.Problem
Collection and pipeline configuration that is awkward to quote as inline JSON had to be stuffed into the shell. That is brittle on HPC and encourages copying values into shell history.
Solution
Add
parse_cli_config(): if the value is an existing file, load it as YAML/JSON; otherwise parse it as inline JSON as before. Empty input still yields{}.Impact
Existing inline-JSON scripts keep working. You can pass
--config collection.yml. No schema change.Testing
Unit tests for empty input, inline JSON, YAML/JSON files, missing paths, and malformed YAML. CLI test that
marimba new pipeline --config path.ymlpasses the parsed dict through. 22 passed. Ruff/black clean on the touched files.Documentation
CHANGELOG Unreleased,
docs/cli.md,docs/overview.md.Breaking Changes
None. Inline JSON remains supported.
Notes to Reviewer
If
--confignames a path that exists, it is always treated as a file, even if the string also happens to be valid JSON.