Merged in feature/override-aa-derived-eff-date (pull request #423)

Feature/override aa derived eff date

* Implement special handling for AARETE_DERIVED_TERMINATION_DATE based on CONTRACT_AUTO_RENEWAL_IND

* Refine prompts for CONTRACT_AUTO_RENEWAL_IND and CONTRACT_AUTO_RENEWAL_TERM for clarity

* move special handling for derived effective date to postprocess step

* Remove unnecessary blank line in get_crosswalk_and_derived function


Approved-by: Katon Minhas
This commit is contained in:
Alex Galarce
2025-02-27 22:57:38 +00:00
parent 25066747e5
commit 0fee01ace8
2 changed files with 10 additions and 2 deletions
@@ -28,6 +28,14 @@ def postprocess(df):
# Derived termination date
df['AARETE_DERIVED_TERMINATION_DATE'] = list(map(invoke_derived_term_date, df['CONTRACT_EFFECTIVE_DT'], df['CONTRACT_TERMINATION_DT']))
# Special handling for AARETE_DERIVED_TERMINATION_DATE
# Overwrite AARETE_DERIVED_TERMINATION_DATE "9999/01/01" if CONTRACT_AUTO_RENEWAL_IND is "Y"
if "AARETE_DERIVED_TERMINATION_DATE" in df.columns and "CONTRACT_AUTO_RENEWAL_IND" in df.columns:
df.loc[
df["CONTRACT_AUTO_RENEWAL_IND"] == "Y",
"AARETE_DERIVED_TERMINATION_DATE"
] = "9999/01/01"
# Standardize output column order - this should ALWAYS be the final postprocessing step
@@ -284,7 +284,7 @@
"field_name": "CONTRACT_AUTO_RENEWAL_IND",
"relationship": "one_to_one",
"field_type": "smart_chunked",
"prompt": "If this contract automatically renews, answer Y. If this contract will remain in effect unless terminated, answer Y. If it will terminate after the mentioned termination date, answer N.",
"prompt": "If this contract automatically renews, answer Y. If this contract will remain in effect unless terminated, answer Y. Otherwise, answer N.",
"keywords" : ["Renew", "renew", "Auto renew", "auto renew", "automatically renew", "evergreen", "Evergreen"],
"methodology" : "or",
"case_sensitive" : "True"
@@ -293,7 +293,7 @@
"field_name": "CONTRACT_AUTO_RENEWAL_TERM",
"relationship": "one_to_one",
"field_type": "smart_chunked",
"prompt": "If contract automatically renews, then what is the length of the renewal term? This is related to the term and termination agreement section of the contract. This should a one or two word statement, typically around renewal, automatic renewal, or auto-renewal. Only return the length of time for the renewal, do not provide any context.",
"prompt": "If contract automatically renews, then what is the length of the renewal term? This is related to the term and termination agreement section of the contract. This should be a one or two word statement, typically around renewal, automatic renewal, or auto-renewal. Only return the length of time for the renewal, do not provide any context.",
"keywords" : ["Renew", "renew", "Auto renew", "auto renew", "automatically renew", "evergreen", "Evergreen"],
"methodology" : "or",
"case_sensitive" : "True"