Skip to content

Commit

Permalink
Remove end date as part of appointment unique key
Browse files Browse the repository at this point in the history
Why these changes are being introduced:

An employee appointment's end date was used as part of its
enduring unique key in Quickbase, but this was flawed.  When
an appointment ended, the end date was changed from 2999-12-31 to
the actual end date, changing the unique key, and effectively
leaving an extra row in Quickbase.

How this addresses that need:

Removing the end date as part of the employee appointment key is
sufficient to make them enduringly unique.

Side effects of this change:
* This required dropping and recreating the Employee Appointments
table via a manual run, but otherwise no changes.

Relevant ticket(s):
* None
  • Loading branch information
ghukill committed Jan 6, 2025
1 parent cef85b8 commit bd3e83d
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 7 deletions.
3 changes: 0 additions & 3 deletions hrqb/tasks/employee_appointments.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def get_dataframe(self) -> pd.DataFrame:
row.mit_id,
row.position_id,
row.appt_begin_date,
row.appt_end_date,
),
axis=1,
)
Expand Down Expand Up @@ -139,14 +138,12 @@ def generate_merge_key(
mit_id: str,
position_id: str,
appt_begin_date: str,
appt_end_date: str,
) -> str:
return md5_hash_from_values(
[
mit_id,
position_id,
appt_begin_date,
appt_end_date,
]
)

Expand Down
1 change: 0 additions & 1 deletion hrqb/tasks/employee_leave.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def get_dataframe(self) -> pd.DataFrame:
row.mit_id,
row.position_id,
row.appt_begin_date,
row.appt_end_date,
),
axis=1,
)
Expand Down
1 change: 0 additions & 1 deletion hrqb/tasks/employee_salary_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def get_dataframe(self) -> pd.DataFrame:
row.mit_id,
row.position_id,
row.appt_begin_date,
row.appt_end_date,
),
axis=1,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ def task_shared_extract_qb_employee_appointments_complete(all_tasks_pipeline_nam
"Related Employee Type": "Admin Staff",
"Union Name": "Le Union",
"Exempt / NE": "E",
"Key": "868ce513323c5391ae8afaa0ceb70c69",
"Key": "00f6099d6777bd9b6985bf86eeb3e449",
}
]
)
Expand Down
1 change: 0 additions & 1 deletion tests/tasks/test_employee_appointments.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,5 @@ def test_task_transform_employee_appointments_key_expected_from_row_data(
row["MIT ID"],
row["Position ID"],
row["Begin Date"],
row["End Date"],
]
)

0 comments on commit bd3e83d

Please sign in to comment.