From eb5b678bcd0f9240f13027b96d14621ad3678bb6 Mon Sep 17 00:00:00 2001 From: "tim.reichard" Date: Thu, 16 Feb 2023 14:19:54 -0600 Subject: [PATCH] Revise ethnicity check in EFI and increase truncation limit --- HISTORY.rst | 5 +++++ aioradio/file_ingestion.py | 31 +------------------------------ setup.py | 2 +- 3 files changed, 7 insertions(+), 31 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 67c9d19..c181d15 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -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. diff --git a/aioradio/file_ingestion.py b/aioradio/file_ingestion.py index 0fb1ac9..04610a1 100644 --- a/aioradio/file_ingestion.py +++ b/aioradio/file_ingestion.py @@ -142,7 +142,7 @@ def __post_init__(self): "StudentAthlete": 50, "CampusLocation": 50, "Email": 75, - "Ethnicity": 1, + "Ethnicity": 50, "FirstGenFlag": 1, "EFC": 20, "HSCode": 6, @@ -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. @@ -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. @@ -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. diff --git a/setup.py b/setup.py index f8d1ac5..00e5c29 100644 --- a/setup.py +++ b/setup.py @@ -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",