-
Notifications
You must be signed in to change notification settings - Fork 1.7k
chore(data-warehouse): Update job and schema statuses #32704
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
base: master
Are you sure you want to change the base?
Conversation
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.
PR Summary
This PR updates status enums in the data warehouse system to standardize naming conventions and prepare for billing limit features.
- Updates schema status
Error
toFailed
to match job status naming in/posthog/migrations/0743_dwh_model_statuses.py
- Renames
Cancelled
status toBillingLimitReached
across schemas and jobs - Adds new
BillingLimitTooLow
status for upcoming billing features - Migration is irreversible (uses
noop
for reverse SQL) which could make rollbacks challenging - Status field length constraints should be verified to accommodate longer status names
12 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile
frontend/src/scenes/data-warehouse/settings/DataWarehouseManagedSourcesTable.tsx
Show resolved
Hide resolved
@@ -26,7 +26,7 @@ def update_external_job_status( | |||
model.save() | |||
|
|||
if status == ExternalDataJob.Status.FAILED: | |||
schema_status: ExternalDataSchema.Status = ExternalDataSchema.Status.ERROR | |||
schema_status: ExternalDataSchema.Status = ExternalDataSchema.Status.FAILED | |||
else: | |||
schema_status = status # type: ignore |
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.
logic: Type ignore here is dangerous - should explicitly check if status is a valid schema status instead of relying on type coercion
if status == ExternalDataJob.Status.FAILED: | ||
schema_status: ExternalDataSchema.Status = ExternalDataSchema.Status.ERROR | ||
schema_status: ExternalDataSchema.Status = ExternalDataSchema.Status.FAILED | ||
else: | ||
schema_status = status # type: ignore | ||
|
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.
style: Consider handling other terminal states (like CANCELLED/BILLING_LIMITS_REACHED) explicitly rather than defaulting them
Size Change: +5 B (0%) Total Size: 3.72 MB ℹ️ View Unchanged
|
Changes
status
enum for schemas and jobs to be more aligned:Error
to match the JobsFailed
Billing Limits Too Low
for upcoming PRHow did you test this code?
Checked frontend statuses