Skip to content
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

feat(source-errors): Percolates and fixes source errors #28356

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

Conversation

phixMe
Copy link
Contributor

@phixMe phixMe commented Feb 5, 2025

Problem

Users currently have no idea why a source is not working since we don't really tell them anything regarding a failure. I also noticed some issues about percolating data between the source, schema, and job db tables and synced up the schema and job.

I also noticed that we fallback to an erroneous Running state when should_sync gets disabled by an error that cannot be retried which creates confusing visual experience.

Schema Page (w/ suspended state)

image

Changes

  • Sources (Only reports 1st error) and searches now report what errors are in a tooltip.
  • Updates prefetch to include schemas with errors so that we inherit the error state.

Note: We could also adjust the should_sync on the job side, but I think we have our reasons for doing this.

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

Tried with failing connection a couple different ways

@phixMe phixMe changed the title feature(source-errors): Percolates and fixes source errors feat(source-errors): Percolates and fixes source errors Feb 5, 2025
Copy link
Contributor

github-actions bot commented Feb 5, 2025

Size Change: 0 B

Total Size: 1.18 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 1.18 MB

compressed-size-action

.filter(should_sync=True)
.filter(
Q(should_sync=True) | Q(latest_error__isnull=False)
) # OR to include schemas with errors or marked for sync
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Gilbert09 This does change what is returned in a test since it includes records with non-null errors. I think this is what we want since the latest_error will get nulled out when the connection is rectified.

Copy link
Member

Choose a reason for hiding this comment

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

I guess my question here is whether we want the source to say Error when the errored schema is now disabled?

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 we add a new visual state, like SUSPENDED or something like that?

@phixMe phixMe marked this pull request as ready for review February 7, 2025 18:10
@phixMe phixMe requested a review from a team February 7, 2025 18:10
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 enhances error reporting and visibility for external data sources in PostHog's data warehouse integration.

  • Added latest_error field propagation from jobs through schemas to sources in /posthog/warehouse/api/external_data_source.py
  • Implemented error tooltips in status columns for both source and schema tables in /frontend/src/scenes/data-warehouse/settings/DataWarehouseManagedSourcesTable.tsx
  • Fixed status fallback behavior to prevent incorrect "Running" state when errors occur
  • Modified schema prefetch logic to include errored schemas even when sync is disabled
  • Added proper error state synchronization between jobs, schemas and sources in /posthog/warehouse/external_data_source/jobs.py

6 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

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.

3 participants