-
Notifications
You must be signed in to change notification settings - Fork 0
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
HRQB 35 - Generated Performance Review records from Employee Appointments #67
Conversation
Why these changes are being introduced: For development, it is sometimes required that some or all records from a QB table are deleted. This is strangely not trivial in QB. Paginated deletes in the GUI are slow and time consuming, and the API requires a somewhat cryptic query payload. A testable, normalized way of deleting records is helpful. How this addresses that need: * QBClient gets two new methods, delete_records() and delete_all_table_records() Side effects of this change: * None Relevant ticket(s): * None
Why these changes are being introduced: Performance Reviews in Quickbase are based on Employee Appointments. They should be dynamically generated in the types of 3 month, 6 month, and annual reviews. This HRQBClient is responsible for making the performance review record, but NOT the outcome of the review; this is manually filled in by HR. How this addresses that need: * Adds new ETL tasks for Performance Reviews and Years (lookup table) Side effects of this change: * Performance Reviews loaded Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/HRQB-35
return years_df[fields.keys()].rename(columns=fields) | ||
|
||
|
||
class LoadYears(QuickbaseUpsertTask): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little unusual that Quickbase has a table dedicated to just years... but that's how it was setup. This Load task ensures that all years from the Performance Reviews
ETL tasks that will get written, have a value in the lookup table Years
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, one optional suggestion!
hrqb/utils/__init__.py
Outdated
""" | ||
|
||
def convert_to_date( | ||
value: Any, # noqa: ANN401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to do str | int | datetime.datetime | pd.Timestamp
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great call. I've updated to (commit):
value: str | datetime.datetime | pd.Timestamp,
The advantage here is that these are the expected types, which will get handled by logic arms, but if we get an oddball type, it'll just return None
. In that way, the type hinting helps understand what it can/should handle. Thanks for the suggestion!
@ghukill Looks great! |
Purpose and background context
This PR adds ETL tasks to generate
Performance Reviews
records. These records do not contain the actual review, only the placeholder record in Quickbase that HR will manually complete.Reviews come in three types:
There is a bit of logic to skip annual reviews if they overlap with a 3 or 6 month review.
Additionally included in this PR is an added ability for the Quickbase client
QBClient
to delete records from a table (commit). As noted in the commit message, deletes are difficult in Quickbase. Mostly for good reason, this can hamper development where sometimes it's required to clear the table. This functionality should be exercised with caution as we move into production, but is generally quite safe given its functionality is not exposed via the CLI or any ETL tasks; only direct command line invocation can utilize it.How can a reviewer manually see the effects of these changes?
As per usual, the only way to verify these changes at the moment are through the tests added.
Includes new or updated dependencies?
NO
Changes expectations for external applications?
NO
What are the relevant tickets?
Developer
Code Reviewer(s)