-
Notifications
You must be signed in to change notification settings - Fork 86
fix: processor artifacts type, discovery, and loading #366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
andreatgretel
merged 7 commits into
main
from
andreatgretel/fix/processor-artifacts-cleanup
Mar 6, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2819f25
fix: processor artifacts type annotation, discovery, and loading
andreatgretel 531c761
fix: deduplicate list_processor_names when both dir and file exist
andreatgretel 9d1bb59
refactor: extract standalone functions for processor discovery and lo…
andreatgretel 8ecaeec
refactor: move standalone functions to io_helpers in config package
andreatgretel 0a740f3
chore: trim docstrings and deduplicate tests
andreatgretel f74a8e5
fix: align get_processor_file_paths with list_processor_names
andreatgretel b5b49e2
Merge branch 'main' into andreatgretel/fix/processor-artifacts-cleanup
andreatgretel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,6 +94,30 @@ def save_config_file(file_path: Path, config: dict) -> None: | |
| ) | ||
|
|
||
|
|
||
| def list_processor_names(processors_outputs_path: Path) -> list[str]: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These processor helpers are standalone (not on |
||
| """Discover processor names from directories and parquet files under the given path.""" | ||
| if not processors_outputs_path.exists(): | ||
| return [] | ||
| names: dict[str, None] = {} | ||
| for entry in sorted(processors_outputs_path.iterdir()): | ||
| if entry.is_dir(): | ||
| names[entry.name] = None | ||
| elif entry.suffix == ".parquet": | ||
| names[entry.stem] = None | ||
| return list(names) | ||
|
|
||
|
|
||
| def load_processor_dataset(processors_outputs_path: Path, processor_name: str) -> pd.DataFrame: | ||
| """Load a processor's output dataset, checking for a directory first then a single parquet file.""" | ||
| dir_path = processors_outputs_path / processor_name | ||
| file_path = processors_outputs_path / f"{processor_name}.parquet" | ||
| if dir_path.is_dir(): | ||
| return read_parquet_dataset(dir_path) | ||
| if file_path.is_file(): | ||
| return read_parquet_dataset(file_path) | ||
| raise FileNotFoundError(f"No artifacts found for processor named {processor_name!r}") | ||
andreatgretel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| def read_parquet_dataset(path: Path) -> pd.DataFrame: | ||
| """Read a parquet dataset from a path. | ||
|
|
||
|
|
||
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.