Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

* filter, merge: Fixed formatting of the error message shown when there are duplicate sequence ids. [#1954][] @victorlin
* filter: Adjusted the error message shown when there are missing weights to mention the option of updating values in metadata. [#1956][] @victorlin
* The helper function `augur.subsample.get_referenced_files` now shows errors when used in a lambda expression for a Snakemake input. [#1955][] (@victorlin)

[#1954]: https://github.com/nextstrain/augur/pull/1954
[#1955]: https://github.com/nextstrain/augur/pull/1955
[#1956]: https://github.com/nextstrain/augur/pull/1956

## 33.0.0 (26 January 2026)
Expand Down
24 changes: 15 additions & 9 deletions augur/subsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,21 @@ def get_referenced_files(
set
Resolved filepaths
"""
# Load schema, parse and validate config.
schema_validator = load_json_schema("schema-subsample-config.json")
config = _parse_config(config_file, config_section, schema_validator)

# Resolve filepaths.
search_path_objs = _get_search_paths(config_file, search_paths)
config, filepaths = _resolve_filepaths(config, search_path_objs, schema_validator.schema)

return set(filepaths)
# TODO: Remove try/except once Snakemake bug is fixed.
# <https://github.com/snakemake/snakemake/issues/3953>
try:
# Load schema, parse and validate config.
schema_validator = load_json_schema("schema-subsample-config.json")
config = _parse_config(config_file, config_section, schema_validator)

# Resolve filepaths.
search_path_objs = _get_search_paths(config_file, search_paths)
config, filepaths = _resolve_filepaths(config, search_path_objs, schema_validator.schema)

return set(filepaths)
except Exception as e:
print_err(f"ERROR: {e}")
raise e


def _parse_config(filename: str, config_section: Optional[List[str]], schema) -> Dict[str, Any]:
Expand Down