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(data-warehouse): New snowflake source #29317

Merged
merged 5 commits into from
Feb 28, 2025
Merged

feat(data-warehouse): New snowflake source #29317

merged 5 commits into from
Feb 28, 2025

Conversation

Gilbert09
Copy link
Member

Changes

  • Adds a new snowflake source using the snowflake-connector-python package, supported by snowflake!
  • No need to mess around with schemas/types, the pip package supports fetching as a pyarrows table!
  • We can't dictate the size of the batch that gets returned by snowflake servers, so lets see how this goes!

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

Yes

How did you test this code?

Yep, tested a bunch locally

@Gilbert09 Gilbert09 requested a review from a team February 27, 2025 17:43
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 adds a new Snowflake data source to PostHog's data warehouse functionality, leveraging the snowflake-connector-python package for simplified data retrieval.

  • Added posthog/temporal/data_imports/pipelines/snowflake/snowflake.py with support for both password and key-based authentication
  • Updated snowflake-connector-python from version 3.6.0 to 3.13.2 in requirements files
  • Implemented PyArrow-based data retrieval for efficient schema/type handling without manual mapping
  • Modified import_data_sync.py to use the dedicated snowflake module instead of generic sql_database
  • Removed unused team_id parameter from mysql_source function for code cleanup

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

Comment on lines +17 to +20
user: Optional[str],
password: Optional[str],
passphrase: Optional[str],
private_key: Optional[str],
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you could possibly handle the optionals earlier in the other function, to avoid optional parameter passing through 2 functions the chain here, but not a huge deal either way.

Copy link
Contributor

@phixMe phixMe left a comment

Choose a reason for hiding this comment

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

Nice, probably want to monitor this one.

@Gilbert09 Gilbert09 enabled auto-merge (squash) February 28, 2025 08:50
@Gilbert09 Gilbert09 merged commit 8fef3f6 into master Feb 28, 2025
69 of 87 checks passed
@Gilbert09 Gilbert09 deleted the tom/snowflake branch February 28, 2025 09:01
Gilbert09 added a commit that referenced this pull request Feb 28, 2025
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