add rastervision check command to validate config URIs - #2328
Open
Pranava-Kumar wants to merge 1 commit into
Open
add rastervision check command to validate config URIs#2328Pranava-Kumar wants to merge 1 commit into
Pranava-Kumar wants to merge 1 commit into
Conversation
Adds a new CLI subcommand that recursively walks a PipelineConfig tree, collects all URI fields via collect_uris(), and verifies they are accessible using file_exists() before running the pipeline. Implements issue azavea#1154.
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
Adds
rastervision checkCLI command that validates all URIs in a PipelineConfig without running the pipeline. Users can verify their config files are accessible before kicking off a long-running job, avoiding late-stage failures from bad S3 paths or missing files.Changes
collect_uris()utility (file_system/utils.py): Recursively walks a pydanticBaseModeltree to find all fields ending inuri/uris. Handles nested models, lists, dicts, andNonevalues.checkCLI subcommand (cli.py): Loads a config module viaget_configs(), collects all URIs, checks each withfile_exists(), and reports results with color-coded output and a summary line.tests/pipeline/test_cli_check.py): 12 unit tests forcollect_uris()and 7 integration tests for the CLI command usingCliRunner.Usage
Output:
Related Issue
Closes #1154