Skip to content

Commit

Permalink
fixed errors pointed by ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
Nargis Sultani committed Aug 25, 2023
1 parent da2b542 commit 44b1f50
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
23 changes: 12 additions & 11 deletions src/validator/phase_validations.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ def get_phase_1_and_2_validations_for_lei(lei: str = None):
string_contains,
name="uid.invalid_uid_lei",
description=(
"The first 20 characters of the 'unique identifier' should match "
"the Legal Entity Identifier (LEI) for the financial institution."
"The first 20 characters of the 'unique identifier' should"
" match the Legal Entity Identifier (LEI) for the financial"
" institution."
),
element_wise=True,
containing_value=lei,
Expand Down Expand Up @@ -950,11 +951,11 @@ def get_phase_1_and_2_validations_for_lei(lei: str = None):
description=(
"When 'interest rate type' does not equal 1"
" (adjustable interest rate, no initial rate period),"
" 3 (initial rate period > 12 months, adjustable interest rate),"
" or 5 (initial rate period <= 12 months, variable interest"
" rate), 'adjustable rate transaction: margin' must be blank."
" When 'interest rate type' equals 1, 3, or 5, 'variable"
" rate transaction: margin' must not be blank."
" 3 (initial rate period > 12 months, adjustable interest"
" rate), or 5 (initial rate period <= 12 months, variable "
"interest rate), 'adjustable rate transaction: margin' must "
"be blank. When 'interest rate type' equals 1, 3, or 5, "
"'variable rate transaction: margin' must not be blank."
),
groupby="pricing_interest_rate_type",
condition_values={"1", "3", "5"},
Expand All @@ -978,8 +979,8 @@ def get_phase_1_and_2_validations_for_lei(lei: str = None):
is_valid_enum,
name="pricing_adj_index_name.invalid_enum_value",
description=(
"'Adjustable rate transaction: index name' must equal 1, 2, 3, 4,"
"5, 6, 7, 8, 9, 10, 977, or 999."
"'Adjustable rate transaction: index name' must equal "
"1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 977, or 999."
),
element_wise=True,
accepted_values=[
Expand Down Expand Up @@ -1036,8 +1037,8 @@ def get_phase_1_and_2_validations_for_lei(lei: str = None):
max_value=300,
name="pricing_adj_index_name_ff.invalid_text_length",
description=(
"'Adjustable rate transaction: index name: other' must not exceed"
"300 characters in length."
"'Adjustable rate transaction: index name: other' must not"
" exceed 300 characters in length."
),
),
],
Expand Down
8 changes: 4 additions & 4 deletions src/validator/schema_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,13 +505,13 @@
),
}


def get_template() -> Dict:
"""Returns a deep copy of the above schema_template object.
"""Returns a deep copy of the above schema_template object.
This is done because this dictionary template is going to be
modified both by the phase 1 imputer and phase 2 imputer. This can
cause absolute havoc in a program and it's proactically impossible
to debug."""

return deepcopy(_schema_template)

0 comments on commit 44b1f50

Please sign in to comment.