Skip to content

IN-1208 - Add "Gender" and "Union Seniority Date" to Employees table #205

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

Merged
merged 1 commit into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions hrqb/tasks/employees.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def get_dataframe(self) -> pd.DataFrame:
"date_of_birth",
"mit_hire_date",
"mit_lib_hire_date",
"union_seniority_date",
"last_lib_appt_end_date",
"i9_form_expiration_date",
],
Expand All @@ -53,6 +54,7 @@ def get_dataframe(self) -> pd.DataFrame:
"date_of_birth": "Date of Birth",
"mit_hire_date": "Original Hire Date at MIT",
"mit_lib_hire_date": "Original Hire Date at MIT Libraries",
"union_seniority_date": "Union Seniority Date",
"last_lib_appt_end_date": "End Date",
"home_addr_street1": "Street 1",
"home_addr_street2": "Street 2",
Expand All @@ -65,6 +67,7 @@ def get_dataframe(self) -> pd.DataFrame:
"office_phone": "Work Phone",
"home_phone": "Cell Phone Number",
"ethnic_origin": "Ethnicity",
"gender": "Gender",
"emergency_contact_name": "Emergency Contact Name",
"emergency_contact_relation": "Emergency Contact Relationship",
"emergency_contact_email": "Emergency Contact Email",
Expand Down
3 changes: 3 additions & 0 deletions hrqb/tasks/sql/employees.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ CHANGELOG
- 2025-02-05 Remove 2019-01-01 date cutoff entirely
- 2025-02-05 Add CTE 'last_appt_termination_txn' to ensure only the last termination
reason is included to avoid duplicating employee rows
- 2025-03-25 Include Union Seniority Date and Gender in query
*/

-- get all library appointments for employee, ordered
Expand Down Expand Up @@ -74,6 +75,7 @@ select
e.NAME_KNOWN_BY as PREFERRED_NAME,
e.DATE_OF_BIRTH,
e.ORIGINAL_HIRE_DATE AS MIT_HIRE_DATE,
e.UNION_SENIORITY_DATE,
e.CURRENT_EMPLOYMENT_DATE as MIT_LIB_HIRE_DATE,
llad.LAST_LIB_APPT_END_DATE,
e.HOME_ADDR_STREET1,
Expand All @@ -87,6 +89,7 @@ select
e.OFFICE_PHONE,
e.HOME_PHONE,
e.ETHNIC_ORIGIN,
e.GENDER,
e.EMERGENCY_CONTACT_NAME,
e.EMERGENCY_CONTACT_RELATION,
e.EMERGENCY_CONTACT_EMAIL,
Expand Down
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ def task_extract_dw_employees_dw_dataframe():
"date_of_birth": datetime.datetime(1985, 4, 12),
"mit_hire_date": datetime.datetime(2010, 8, 15),
"mit_lib_hire_date": datetime.datetime(2012, 6, 20),
"union_seniority_date": datetime.datetime(2012, 6, 20),
"last_lib_appt_end_date": "2025-12-31",
"home_addr_street1": "123 Elm Street",
"home_addr_street2": "Apt 456",
Expand All @@ -474,6 +475,7 @@ def task_extract_dw_employees_dw_dataframe():
"office_phone": "617-253-1234",
"home_phone": "617-555-6789",
"ethnic_origin": "Two or more races, not Hispanic/Latino",
"gender": "female",
"emergency_contact_name": "Jane Doe",
"emergency_contact_relation": "Spouse",
"emergency_contact_email": "[email protected]",
Expand Down