Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include New Citizenship Status Value #3428

Merged
merged 7 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
condition_field_name="FAMILY_AFFILIATION",
condition_function=category3.isEqual(1),
result_field_name="CITIZENSHIP_STATUS",
result_function=category3.isOneOf((1, 2)),
result_function=category3.isOneOf((1, 2, 3)),
),
category3.ifThenAlso(
condition_field_name="FAMILY_AFFILIATION",
Expand Down Expand Up @@ -415,7 +415,7 @@
startIndex=57,
endIndex=58,
required=False,
validators=[category2.isOneOf([0, 1, 2, 9])],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ADPennington We also treat 0 as a valid value for Item 42 in the T2 file as a Cat 2 check. I'm not sure if this is intentional or an oversight. Is there any reason why would have wanted to give STTs the flexibility to submit blank/0 in this field rather than 9 ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I believe it was a relic of an earlier version of the updated coding instructions. I believe it was before we tested whether 0 would cause problems in FTANF. We can test it again to be sure and spin up a new ticket to remove it. 0 should only be possible if the field is "optional" for certain types of reported individuals.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is helpful! I'll make a note to investigate and work on a follow up ticket!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to confirm that this can merge then, or does zero need to be removed from possible values?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep @elipe17 -- let's proceed with merging. 🚀 cc: @klinkoberstar @lhuxraft

validators=[category2.isOneOf([0, 1, 2, 3, 9])],
),
Field(
item="43",
Expand Down
12 changes: 6 additions & 6 deletions tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@
condition_field_name="FAMILY_AFFILIATION",
condition_function=category3.isEqual(1),
result_field_name="CITIZENSHIP_STATUS",
result_function=category3.isOneOf((1, 2)),
result_function=category3.isOneOf((1, 2, 3)),
),
category3.ifThenAlso(
condition_field_name="FAMILY_AFFILIATION",
condition_function=category3.isEqual(2),
result_field_name="CITIZENSHIP_STATUS",
result_function=category3.isOneOf((1, 2, 9)),
result_function=category3.isOneOf((1, 2, 3, 9)),
),
],
fields=[
Expand Down Expand Up @@ -300,7 +300,7 @@
startIndex=51,
endIndex=52,
required=False,
validators=[category2.isOneOf([1, 2, 9])],
validators=[category2.isOneOf([1, 2, 3, 9])],
),
Field(
item="77A",
Expand Down Expand Up @@ -407,13 +407,13 @@
condition_field_name="FAMILY_AFFILIATION",
condition_function=category3.isEqual(1),
result_field_name="CITIZENSHIP_STATUS",
result_function=category3.isOneOf((1, 2)),
result_function=category3.isOneOf((1, 23, )),
jtimpe marked this conversation as resolved.
Show resolved Hide resolved
),
category3.ifThenAlso(
condition_field_name="FAMILY_AFFILIATION",
condition_function=category3.isEqual(2),
result_field_name="CITIZENSHIP_STATUS",
result_function=category3.isOneOf((1, 2, 9)),
result_function=category3.isOneOf((1, 2, 3, 9)),
),
],
fields=[
Expand Down Expand Up @@ -616,7 +616,7 @@
startIndex=92,
endIndex=93,
required=False,
validators=[category2.isOneOf([1, 2, 9])],
validators=[category2.isOneOf([1, 2, 3, 9])],
),
Field(
item="77A",
Expand Down
4 changes: 2 additions & 2 deletions tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
condition_field_name="FAMILY_AFFILIATION",
condition_function=category3.isEqual(1),
result_field_name="CITIZENSHIP_STATUS",
result_function=category3.isBetween(1, 2, inclusive=True),
result_function=category3.isBetween(1, 3, inclusive=True),
),
category3.ifThenAlso(
condition_field_name="DATE_OF_BIRTH",
Expand Down Expand Up @@ -364,7 +364,7 @@
required=False,
validators=[
category3.orValidators([
category3.isBetween(0, 2, inclusive=True),
category3.isBetween(0, 3, inclusive=True),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elipe17 @klinkoberstar this change works as expected, but i am also noticing that 0 is allowed and seems inconsistent with the coding instructions for item 25 (see screenshot here)

category3.isEqual(9)
])
],
Expand Down
2 changes: 1 addition & 1 deletion tdrs-backend/tdpservice/parsers/test/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ def test_parse_t3_cat2_invalid_citizenship(t3_cat2_invalid_citizenship_file, dfs
assert parser_errors.count() == 2

for e in parser_errors:
assert e.error_message == "T3 Item 76 (Citizenship/Immigration Status): 0 is not in [1, 2, 9]."
assert e.error_message == "T3 Item 76 (Citizenship/Immigration Status): 0 is not in [1, 2, 3, 9]."


@pytest.mark.django_db()
Expand Down
Loading