Skip to content

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Gilbert09
Copy link
Member

Changes

  • Updated the status enum for schemas and jobs to be more aligned:
    • Updated Cancelled => Billing Limits Reached
    • Updated schemas Error to match the Jobs Failed
    • Added Billing Limits Too Low for upcoming PR
  • Added migrations for the above
  • Updated the frontend code too

How did you test this code?

Checked frontend statuses

@Gilbert09 Gilbert09 requested a review from a team May 27, 2025 12:20
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 to Failed to match job status naming in /posthog/migrations/0743_dwh_model_statuses.py
  • Renames Cancelled status to BillingLimitReached 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

@@ -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
Copy link
Contributor

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

Comment on lines 28 to 32
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

Copy link
Contributor

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

Copy link
Contributor

Size Change: +5 B (0%)

Total Size: 3.72 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 3.72 MB +5 B (0%)

compressed-size-action

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