Skip to content

Commit 99f1711

Browse files
fix: don't error if node data file is empty
In PR #728, extra node data validation was introduced. In particular, files without information for either `nodes` or `branches` caused erroring. This is problematic for test scripts that may produce empty node data in test cases. This PR removes the eager validation. In the future we could reintroduce it as a warning. And possibly an error but with opt-out.
1 parent aade8fd commit 99f1711

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

augur/util_support/node_data_file.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import json
22

3-
from augur.__version__ import __version__
4-
from augur.__version__ import is_augur_version_compatible
3+
from augur.__version__ import __version__, is_augur_version_compatible
54
from augur.errors import AugurError
65
from augur.io.print import print_err
76
from augur.types import ValidationMode
8-
from augur.validate import validate_json, ValidateError, load_json_schema
9-
7+
from augur.validate import ValidateError, load_json_schema, validate_json
108

119
FILTERED_ATTRS = ["generated_by"]
1210

@@ -82,11 +80,6 @@ def validate(self):
8280
raise AugurError(
8381
f"`branches` value in {self.fname} is not a dictionary. Please check the formatting of this JSON!" )
8482

85-
if not self.nodes and not self.branches:
86-
raise AugurError(
87-
f"{self.fname} did not contain either `nodes` or `branches`. Please check the formatting of this JSON!"
88-
)
89-
9083
if self.validation_mode is not ValidationMode.SKIP and self.is_generated_by_incompatible_augur:
9184
msg = (
9285
f"Augur version incompatibility detected: the JSON {self.fname} was generated by "

0 commit comments

Comments
 (0)