Skip to content

Commit

Permalink
Revise ethnicity check in EFI and increase truncation limit
Browse files Browse the repository at this point in the history
  • Loading branch information
tim.reichard committed Feb 16, 2023
1 parent ebbabcd commit eb5b678
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 31 deletions.
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ History
=======


v0.17.34 (2023-02-16)

* Revise ethnicity check in EFI and increase truncation limit.


v0.17.33 (2023-02-14)

* Hardcode openpyxl version to 3.0.10.
Expand Down
31 changes: 1 addition & 30 deletions aioradio/file_ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def __post_init__(self):
"StudentAthlete": 50,
"CampusLocation": 50,
"Email": 75,
"Ethnicity": 1,
"Ethnicity": 50,
"FirstGenFlag": 1,
"EFC": 20,
"HSCode": 6,
Expand Down Expand Up @@ -418,8 +418,6 @@ def __post_init__(self):
'0': 'N'
}

self.ethnicity_federal_categories = {'1', '2', '3', '4', '5', '6', '7', '8'}

def check_width(self, value: str, field: str, row_idx: int) -> str:
"""Check field value and truncate if it is longer than expected.
Expand Down Expand Up @@ -898,21 +896,6 @@ def check_generic_boolean(self, value: str) -> str:

return value

def check_ethnicity(self, value: str) -> str:
"""Check Ethnicity is a federal category value.
Args:
value (str): Ethnicity category
Returns:
str: Ethnicity category
"""

if value != '' and value not in self.ethnicity_federal_categories:
value = ''

return value

@staticmethod
def check_act_score(value: str) -> str:
"""Check ACT Score logic.
Expand Down Expand Up @@ -993,18 +976,6 @@ def check_generic_boolean_efi(self, records: list[str]):
for idx in range(len(records)):
records[idx] = self.check_generic_boolean(records[idx])

def check_ethnicity_efi(self, records: list[str]):
"""Check ethnicity logic.
Args:
records (list[str]): List of a specific columns values
field (str): Column header field value
row_idx (int): Row number in file
"""

for idx in range(len(records)):
records[idx] = self.check_ethnicity(records[idx])

def check_act_score_efi(self, records: list[str]):
"""Check ACT score logic.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
long_description = fileobj.read()

setup(name='aioradio',
version='0.17.33',
version='0.17.34',
description='Generic asynchronous i/o python utilities for AWS services (SQS, S3, DynamoDB, Secrets Manager), Redis, MSSQL (pyodbc), JIRA and more',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit eb5b678

Please sign in to comment.