-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(ds): adds supabase as a beta source. "inherits" from postgres #40773
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.
11 files reviewed, 3 comments
| from posthog.temporal.data_imports.sources.postgres.source import PostgresSource | ||
| from posthog.warehouse.types import ExternalDataSourceType | ||
|
|
||
| postgres = PostgresSource() |
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: module-level instance will use PostgresSource.source_name ("Postgres") in error messages instead of "Supabase"
When validate_credentials is called via postgres.validate_credentials(), errors will say "Could not connect to Postgres" rather than "Could not connect to Supabase" because postgres is an instance of PostgresSource with source_name = "Postgres".
Either:
- Override methods to pass correct source name to error messages
- Make
PostgresSource.source_nameoverridable via constructor - Call
PostgresSourcemethods statically if possible
Prompt To Fix With AI
This is a comment left during a code review.
Path: posthog/temporal/data_imports/sources/supabase/source.py
Line: 15:15
Comment:
**logic:** module-level instance will use `PostgresSource.source_name` ("Postgres") in error messages instead of "Supabase"
When `validate_credentials` is called via `postgres.validate_credentials()`, errors will say "Could not connect to Postgres" rather than "Could not connect to Supabase" because `postgres` is an instance of `PostgresSource` with `source_name = "Postgres"`.
Either:
1. Override methods to pass correct source name to error messages
2. Make `PostgresSource.source_name` overridable via constructor
3. Call `PostgresSource` methods statically if possible
How can I resolve this? If you propose a fix, please make it concise.|
|
||
| @SourceRegistry.register | ||
| class PostgresSource(BaseSource[PostgresSourceConfig], SSHTunnelMixin, ValidateDatabaseHostMixin): | ||
| source_name = "Postgres" |
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: source_name should be overridable to support inheritance patterns like SupabaseSource
Consider allowing source_name to be set via constructor:
| source_name = "Postgres" | |
| def __init__(self, source_name: str = "Postgres"): | |
| super().__init__() | |
| self.source_name = source_name |
Prompt To Fix With AI
This is a comment left during a code review.
Path: posthog/temporal/data_imports/sources/postgres/source.py
Line: 40:40
Comment:
**style:** `source_name` should be overridable to support inheritance patterns like `SupabaseSource`
Consider allowing `source_name` to be set via constructor:
```suggestion
def __init__(self, source_name: str = "Postgres"):
super().__init__()
self.source_name = source_name
```
How can I resolve this? If you propose a fix, please make it concise.|
|
||
|
|
||
| class ExternalDataSourceType(StrEnum): | ||
| SUPABASE = "Supabase" |
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: verify this change was generated by pnpm run schema:build
posthog/schema.py is autogenerated and should not be manually modified. Verify this was generated via the build command and not manually edited.
Context Used: Rule from dashboard - Do not manually modify the posthog/schema.py file as it is autogenerated by the `pnpm run schema:b... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: posthog/schema.py
Line: 1347:1347
Comment:
**style:** verify this change was generated by `pnpm run schema:build`
`posthog/schema.py` is autogenerated and should not be manually modified. Verify this was generated via the build command and not manually edited.
**Context Used:** Rule from `dashboard` - Do not manually modify the `posthog/schema.py` file as it is autogenerated by the `pnpm run schema:b... ([source](https://app.greptile.com/review/custom-context?memory=192de143-59d7-412f-bd71-fe5cb8f161dd))
How can I resolve this? If you propose a fix, please make it concise.|
Size Change: +39 B (0%) Total Size: 3.34 MB ℹ️ View Unchanged
|
Migration SQL ChangesHey 👋, we've detected some migrations on this PR. Here's the SQL output for each migration, make sure they make sense:
|
🔍 Migration Risk AnalysisWe've analyzed your migrations for potential risks. Summary: Run Summary: 0 Safe | 1 Needs Review | 0 Blocked
|
|
Problem
Supabase is low hanging fruit as a source since it's basically postgres.
Changes
Adds supabase as a beta source behind an ff.
Successful sync against test project db:

How did you test this code?
Ran locally and ran a sync job against a test supabase project and db.
Changelog: (features only) Is this feature complete?
No