Skip to content

Commit

Permalink
Merge pull request #210 from CAVEconnectome/within-version-ts-fix
Browse files Browse the repository at this point in the history
fix version constraints for get root timestamps
  • Loading branch information
ceesem authored Aug 16, 2024
2 parents 37d646c + 79e76ac commit 01e3255
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions caveclient/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,13 @@ def wrapper(*args, **kwargs):

if method_constraint is not None:
if _version_fails_constraint(self.server_version, method_constraint):
if isinstance(method_constraint, str):
ms_list = [method_constraint]
else:
ms_list = method_constraint
msg = (
f"Use of method `{method.__name__}` is only permitted "
f"for server version {method_constraint}, your server "
f"for server version {' or '.join(ms_list)}. Your server "
f"version is {self.server_version}. Contact your system "
"administrator to update the server version."
)
Expand All @@ -452,10 +456,14 @@ def wrapper(*args, **kwargs):
if check_kwargs.get(kwarg, None) is None:
continue
elif _version_fails_constraint(self.server_version, kwarg_constraint):
if isinstance(kwarg_constraint, str):
kw_list = [kwarg_constraint]
else:
kw_list = kwarg_constraint
msg = (
f"Use of keyword argument `{kwarg}` in `{method.__name__}` "
"is only permitted "
f"for server version {kwarg_constraint}, your server "
f"for server version {' or '.join(kw_list)}. Your server "
f"version is {self.server_version}. Contact your system "
"administrator to update the server version."
)
Expand Down
4 changes: 2 additions & 2 deletions caveclient/chunkedgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1316,8 +1316,8 @@ def is_valid_nodes(

@_check_version_compatibility(
kwarg_use_constraints={
"latest": [">=2.17.0", ">=1.25.0"],
"timestamp": [">=2.17.0", ">=1.25.0"],
"latest": ["<2,>=1.25.0", "<3,>=2.17.0"],
"timestamp": ["<2,>=1.25.0", "<3,>=2.17.0"],
}
)
def get_root_timestamps(
Expand Down

0 comments on commit 01e3255

Please sign in to comment.