You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement functionality to check that the initial dataset of vacant properties is no more than 5% smaller than the previous run or, if there was no previous run, no smaller than 30,000 records. If this condition is not met, send an alert via Slack and email. This will involve modifying the script to query the previous record count from the PostgreSQL database and compare it with the current record count. Changes will need to be made to ./data/src/script.py and ./data/src/classes/diff_report.py.
Acceptance Criteria
Add a method to DiffReport class in data/src/classes/diff_report.py to get the previous record count from the PostgreSQL database.
Modify the main script in data/src/script.py to use the DiffReport method to get the previous record count.
Implement a comparison of the current and previous record counts in the main script.
If the current count is more than 5% smaller than the previous count or if the initial count is smaller thna 30,000 records, break and:
Send a Slack alert.
Optionally, send an email alert.
Additional context
The Slack alert should use the Slack API and be configured to post to a specific channel.
The email alert should use the SMTP library and be sent to a configured email address.
Ensure proper error handling and logging for both Slack and email alerts.
The text was updated successfully, but these errors were encountered:
Describe the task
Implement functionality to check that the initial dataset of vacant properties is no more than 5% smaller than the previous run or, if there was no previous run, no smaller than 30,000 records. If this condition is not met, send an alert via Slack and email. This will involve modifying the script to query the previous record count from the PostgreSQL database and compare it with the current record count. Changes will need to be made to
./data/src/script.py
and./data/src/classes/diff_report.py
.Acceptance Criteria
DiffReport
class indata/src/classes/diff_report.py
to get the previous record count from the PostgreSQL database.data/src/script.py
to use theDiffReport
method to get the previous record count.Additional context
The text was updated successfully, but these errors were encountered: