Skip to content

IN 1200 - Remove 2019 data cutoff #204

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 6, 2025
Merged

Conversation

ghukill
Copy link
Contributor

@ghukill ghukill commented Mar 6, 2025

Purpose and background context

It was determined that filtering data older than 2019-01-01 is not needed and should no longer be performed by the data loader.

How this addresses that need:

  • Removes SQL filtering for 2019-01-01
  • Filtering for more recent data will be done client-side in Quickbase

How can a reviewer manually see the effects of these changes?

Not possible at this time.

Includes new or updated dependencies?

NO

Changes expectations for external applications?

NO

What are the relevant tickets?

Developer

  • All new ENV is documented in README
  • All new ENV has been added to staging and production environments
  • All related Jira tickets are linked in commit message(s)
  • Stakeholder approval has been confirmed (or is not needed)

Code Reviewer(s)

  • The commit message is clear and follows our guidelines (not just this PR message)
  • There are appropriate tests covering any new functionality
  • The provided documentation is sufficient for understanding any new functionality introduced
  • Any manual tests have been performed or provided examples verified
  • New dependencies are appropriate or there were no changes

Why these changes are being introduced:

It was determined that filtering data older than 2019-01-01 is not needed
and should no longer be performed by the data loader.

How this addresses that need:
* Removes SQL filtering for 2019-01-01
* Filtering for more recent data will be done client-side in Quickbase

Side effects of this change:
* Increased row counts for all tables touched

Relevant ticket(s):
* https://mitlibraries.atlassian.net/browse/IN-1200
@ghukill ghukill marked this pull request as ready for review March 6, 2025 16:05
@ghukill ghukill requested a review from a team March 6, 2025 16:05
Comment on lines +46 to +57
row_number() over (
partition by MIT_ID
order by APPT_BEGIN_DATE desc, APPT_END_DATE desc
) as termination_txn_row_num
from HR_APPT_ACTION_DETAIL ad
left join HR_PERSONNEL_ACTION_TYPE at on at.HR_PERSONNEL_ACTION_TYPE_KEY = ad.HR_PERSONNEL_ACTION_TYPE_KEY
where at.HR_PERSONNEL_ACTION in ('Retirement','Termination')
),
last_appt_termination_txn as (
select * from appt_termination_txns
where termination_txn_row_num = 1
),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of the row_number() sorts the termination reasons, and the new last_appt_termination_txn CTE allows for getting only the most recent one, i.e. the "last" termination reason.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I follow! Hmm, is there every a scenario like the following?:

[{
    "APPT_BEGIN_DATE": "2024-01-01", 
    "APPT_END_DATE": "2025-01-01",
    "termination_txn_row_num":  1
   }, 
 {
   "APPT_BEGIN_DATE": "2023-12-31"
   "APPT_END_DATE": "2025-02-01"
   "termination_txn_row_num": 2
 }]

Copy link

@jonavellecuerdo jonavellecuerdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Just a couple of questions (non-blocking).

@@ -11,6 +11,7 @@ CHANGELOG
- 2024-05-13 Query created and added
- 2024-06-03 Limit rows to appointments that end on or before 2019-01-01
- 2024-06-05 Do not filter on benefits types
- 2025-02-05 Remove 2019-01-01 date cutoff entirely

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, curious why you included this in the changelog if no changes -- beyond this updated comment -- are present in this script?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it got lost in the diff, but this was removed in this file:

where a.APPT_END_DATE >= TO_DATE('2019-01-01', 'YYYY-MM-DD')

Comment on lines +46 to +57
row_number() over (
partition by MIT_ID
order by APPT_BEGIN_DATE desc, APPT_END_DATE desc
) as termination_txn_row_num
from HR_APPT_ACTION_DETAIL ad
left join HR_PERSONNEL_ACTION_TYPE at on at.HR_PERSONNEL_ACTION_TYPE_KEY = ad.HR_PERSONNEL_ACTION_TYPE_KEY
where at.HR_PERSONNEL_ACTION in ('Retirement','Termination')
),
last_appt_termination_txn as (
select * from appt_termination_txns
where termination_txn_row_num = 1
),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I follow! Hmm, is there every a scenario like the following?:

[{
    "APPT_BEGIN_DATE": "2024-01-01", 
    "APPT_END_DATE": "2025-01-01",
    "termination_txn_row_num":  1
   }, 
 {
   "APPT_BEGIN_DATE": "2023-12-31"
   "APPT_END_DATE": "2025-02-01"
   "termination_txn_row_num": 2
 }]

@ghukill ghukill merged commit 09bbac6 into main Mar 6, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants