From 7eea8d9fac1e34a1a0578b07c2585bb9718b8ca3 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Wed, 18 Dec 2024 16:19:41 -0500 Subject: [PATCH] - Linting --- tdrs-backend/tdpservice/parsers/validators/category1.py | 4 ++-- tdrs-backend/tdpservice/parsers/validators/util.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/validators/category1.py b/tdrs-backend/tdpservice/parsers/validators/category1.py index 9b6410728..74bc8e518 100644 --- a/tdrs-backend/tdpservice/parsers/validators/category1.py +++ b/tdrs-backend/tdpservice/parsers/validators/category1.py @@ -147,8 +147,8 @@ def calendarQuarterIsValid(start=0, end=None): # file pre-check validators -## TODO: the validators below are called explicitly with the ability to generate an error. They need a different method -## to deprecate themselves if we ever choose to. +# TODO: the validators below are called explicitly with the ability to generate an error. They need a different method +# to deprecate themselves if we ever choose to. def validate_tribe_fips_program_agree(program_type, tribe_code, state_fips_code, generate_error): """Validate tribe code, fips code, and program type all agree with eachother.""" is_valid = False diff --git a/tdrs-backend/tdpservice/parsers/validators/util.py b/tdrs-backend/tdpservice/parsers/validators/util.py index 5bb3d8e21..d40e8d833 100644 --- a/tdrs-backend/tdpservice/parsers/validators/util.py +++ b/tdrs-backend/tdpservice/parsers/validators/util.py @@ -31,13 +31,14 @@ def validator(value, eargs): def deprecate_validator(validator): """ - Decorator which deprecates an entire validator function. + Deprecate entire validator function. This decorator should ONLY be used on validator functions that return an instance of 'make_validator'. """ def wrapper(*args, **kwargs): wrapper_args = args wrapper_kwargs = kwargs + def deprecated_validator(*args, **kwargs): make_val = validator(*wrapper_args, **wrapper_kwargs) is_valid, error, _ = make_val(*args, **kwargs) @@ -47,8 +48,7 @@ def deprecated_validator(*args, **kwargs): def deprecate_call(validator): - """ - Function that deprecates a top level, evaluated validator. + """Deprecate top level, evaluated validator. This function should wrap invocations of validators in a schema. E.g.: `deprecate_call(category1.recordHasLengthBetween(117, 156))`.