Skip to content

Commit 5687def

Browse files
committed
Include Gender and Union Seniority Date in Employees table
How this addresses that need: * Gender was present in Quickbase, but not pullled from data warehouse * Newly requested Union Seniority Date from data warehouse Side effects of this change: * None Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/IN-1208
1 parent 09bbac6 commit 5687def

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

hrqb/tasks/employees.py

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def get_dataframe(self) -> pd.DataFrame:
3636
"date_of_birth",
3737
"mit_hire_date",
3838
"mit_lib_hire_date",
39+
"union_seniority_date",
3940
"last_lib_appt_end_date",
4041
"i9_form_expiration_date",
4142
],
@@ -53,6 +54,7 @@ def get_dataframe(self) -> pd.DataFrame:
5354
"date_of_birth": "Date of Birth",
5455
"mit_hire_date": "Original Hire Date at MIT",
5556
"mit_lib_hire_date": "Original Hire Date at MIT Libraries",
57+
"union_seniority_date": "Union Seniority Date",
5658
"last_lib_appt_end_date": "End Date",
5759
"home_addr_street1": "Street 1",
5860
"home_addr_street2": "Street 2",
@@ -65,6 +67,7 @@ def get_dataframe(self) -> pd.DataFrame:
6567
"office_phone": "Work Phone",
6668
"home_phone": "Cell Phone Number",
6769
"ethnic_origin": "Ethnicity",
70+
"gender": "Gender",
6871
"emergency_contact_name": "Emergency Contact Name",
6972
"emergency_contact_relation": "Emergency Contact Relationship",
7073
"emergency_contact_email": "Emergency Contact Email",

hrqb/tasks/sql/employees.sql

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ CHANGELOG
1414
- 2025-02-05 Remove 2019-01-01 date cutoff entirely
1515
- 2025-02-05 Add CTE 'last_appt_termination_txn' to ensure only the last termination
1616
reason is included to avoid duplicating employee rows
17+
- 2025-03-25 Include Union Seniority Date and Gender in query
1718
*/
1819

1920
-- get all library appointments for employee, ordered
@@ -74,6 +75,7 @@ select
7475
e.NAME_KNOWN_BY as PREFERRED_NAME,
7576
e.DATE_OF_BIRTH,
7677
e.ORIGINAL_HIRE_DATE AS MIT_HIRE_DATE,
78+
e.UNION_SENIORITY_DATE,
7779
e.CURRENT_EMPLOYMENT_DATE as MIT_LIB_HIRE_DATE,
7880
llad.LAST_LIB_APPT_END_DATE,
7981
e.HOME_ADDR_STREET1,
@@ -87,6 +89,7 @@ select
8789
e.OFFICE_PHONE,
8890
e.HOME_PHONE,
8991
e.ETHNIC_ORIGIN,
92+
e.GENDER,
9093
e.EMERGENCY_CONTACT_NAME,
9194
e.EMERGENCY_CONTACT_RELATION,
9295
e.EMERGENCY_CONTACT_EMAIL,

tests/conftest.py

+2
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ def task_extract_dw_employees_dw_dataframe():
462462
"date_of_birth": datetime.datetime(1985, 4, 12),
463463
"mit_hire_date": datetime.datetime(2010, 8, 15),
464464
"mit_lib_hire_date": datetime.datetime(2012, 6, 20),
465+
"union_seniority_date": datetime.datetime(2012, 6, 20),
465466
"last_lib_appt_end_date": "2025-12-31",
466467
"home_addr_street1": "123 Elm Street",
467468
"home_addr_street2": "Apt 456",
@@ -474,6 +475,7 @@ def task_extract_dw_employees_dw_dataframe():
474475
"office_phone": "617-253-1234",
475476
"home_phone": "617-555-6789",
476477
"ethnic_origin": "Two or more races, not Hispanic/Latino",
478+
"gender": "female",
477479
"emergency_contact_name": "Jane Doe",
478480
"emergency_contact_relation": "Spouse",
479481
"emergency_contact_email": "[email protected]",

0 commit comments

Comments
 (0)