-
Notifications
You must be signed in to change notification settings - Fork 2
Use Kedro-Ibis instead of Snowpark and chained SQL #1
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
Draft
deepyaman
wants to merge
4
commits into
kedro-org:main
Choose a base branch
from
deepyaman:refactor/use-kedro-ibis
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
71f6c88
Use Kedro-Ibis instead of Snowpark and chained SQL
deepyaman 1ce7a97
Address review feedback on Kedro-Ibis refactor
deepyaman 5943f62
Address second round of review feedback
deepyaman 5b04ca3
Fix incorrect .delta() call in get_unique_users
deepyaman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,46 +1,61 @@ | ||
| pypi_kedro_downloads: | ||
| type: kedro_datasets.snowflake.SnowparkTableDataset | ||
| table_name: "V_PYPI_KEDRO_DOWNLOADS" | ||
| database: "KEDRO_BI_DB" # Snowflake database | ||
| schema: "PYPI" # Schema inside the database | ||
| credentials: snowflake_credentials | ||
| heap_project_statistics: | ||
| type: kedro_datasets.ibis.TableDataset | ||
| table_name: KEDRO_PROJECT_STATISTICS | ||
| database: HEAP_FRAMEWORK_VIZ_PRODUCTION.HEAP | ||
| connection: | ||
| backend: snowflake | ||
| credentials: heap_snowflake_credentials | ||
|
|
||
| # Save results locally as CSV | ||
| pypi_kedro_downloads_table: | ||
| type: pandas.CSVDataset | ||
| filepath: data/02_intermediate/pypi_kedro_downloads.csv | ||
| save_args: | ||
| index: False | ||
| heap_any_command_run: | ||
| type: kedro_datasets.ibis.TableDataset | ||
| table_name: ANY_COMMAND_RUN | ||
| database: HEAP_FRAMEWORK_VIZ_PRODUCTION.HEAP | ||
| connection: | ||
| backend: snowflake | ||
| credentials: heap_snowflake_credentials | ||
|
|
||
| new_kedro_users_monthly: | ||
| type: pandas.CSVDataset | ||
| type: kedro_datasets.ibis.FileDataset | ||
| filepath: data/02_intermediate/new_kedro_users_monthly.csv | ||
| save_args: | ||
| index: False | ||
| file_format: csv | ||
|
|
||
| mau_kedro: | ||
| type: pandas.CSVDataset | ||
| type: kedro_datasets.ibis.FileDataset | ||
| filepath: data/02_intermediate/mau_kedro.csv | ||
| save_args: | ||
| index: False | ||
| file_format: csv | ||
|
|
||
| kedro_plugins_mau: | ||
| type: pandas.CSVDataset | ||
| type: kedro_datasets.ibis.FileDataset | ||
| filepath: data/02_intermediate/kedro_plugins_mau.csv | ||
| file_format: csv | ||
|
|
||
| kedro_commands_mau: | ||
| type: pandas.CSVDataset | ||
| type: kedro_datasets.ibis.FileDataset | ||
| filepath: data/02_intermediate/kedro_commands_mau.csv | ||
| file_format: csv | ||
|
|
||
| pypi_kedro_downloads: | ||
| type: kedro_datasets.ibis.TableDataset | ||
| table_name: V_PYPI_KEDRO_DOWNLOADS | ||
| database: KEDRO_BI_DB.PYPI | ||
| connection: | ||
| backend: snowflake | ||
| credentials: snowflake_credentials | ||
|
|
||
| pypi_kedro_downloads_table: | ||
| type: kedro_datasets.ibis.FileDataset | ||
| filepath: data/02_intermediate/pypi_kedro_downloads.csv | ||
| file_format: csv | ||
|
|
||
| downloads_by_country: | ||
| type: kedro_datasets.snowflake.SnowparkTableDataset | ||
| table_name: "V_DOWNLOADS_BY_COUNTRY" | ||
| database: "KEDRO_BI_DB" | ||
| schema: "PYPI" | ||
| type: kedro_datasets.ibis.TableDataset | ||
| table_name: V_DOWNLOADS_BY_COUNTRY | ||
| database: KEDRO_BI_DB.PYPI | ||
| connection: | ||
| backend: snowflake | ||
| credentials: snowflake_credentials | ||
|
|
||
| downloads_by_country_table: | ||
| type: pandas.CSVDataset | ||
| type: kedro_datasets.ibis.FileDataset | ||
| filepath: data/02_intermediate/downloads_by_country.csv | ||
| save_args: | ||
| index: False | ||
| file_format: csv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,21 @@ | ||
| # This is a boilerplate parameters config generated for pipeline 'telemetry_data' | ||
| # using Kedro 1.0.0. | ||
| # | ||
| # Documentation for this file format can be found in "Parameters" | ||
| # Link: https://docs.kedro.org/en/1.0.0/configuration/parameters.html | ||
| plugins: | ||
| - "kedro mlflow" | ||
| - "kedro docker" | ||
| - "kedro airflow" | ||
| - "kedro databricks" | ||
| - "kedro azureml" | ||
| - "kedro vertexai" | ||
| - "kedro gql" | ||
| - "kedro boot" | ||
| - "kedro sagemaker" | ||
| - "kedro coda" | ||
| - "kedro kubeflow" | ||
|
|
||
| commands: | ||
| - "kedro run" | ||
| - "kedro viz" | ||
| - "kedro new" | ||
| - "kedro pipeline" | ||
| - "kedro jupyter" | ||
| - "kedro ipython" | ||
| - "kedro package" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| def fetch_and_save(snowpark_df): | ||
| """Simply returns data read from Snowflake so Kedro saves it as CSV.""" | ||
| pdf = snowpark_df.to_pandas() | ||
| return pdf | ||
| import ibis.expr.types as ir | ||
|
|
||
|
|
||
| def identity(tbl: ir.Table) -> ir.Table: | ||
| return tbl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,22 @@ | ||
| """ | ||
| This is a boilerplate pipeline 'data_transfer' | ||
| generated using Kedro 1.0.0 | ||
| """ | ||
| from kedro.pipeline import Pipeline, node | ||
|
|
||
| from .nodes import identity | ||
|
|
||
| from kedro.pipeline import Node, Pipeline # noqa | ||
| from .nodes import fetch_and_save | ||
|
|
||
| def create_pipeline(**kwargs) -> Pipeline: | ||
| return Pipeline( | ||
| [ | ||
| Node( | ||
| func=fetch_and_save, | ||
| node( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are following the updated pattern of using capital |
||
| identity, | ||
| inputs="pypi_kedro_downloads", | ||
| outputs="pypi_kedro_downloads_table", | ||
| name="fetch_and_save_snowflake_data", | ||
| ), | ||
| Node( | ||
| func=fetch_and_save, | ||
| node( | ||
| identity, | ||
| inputs="downloads_by_country", | ||
| outputs="downloads_by_country_table", | ||
| name="fetch_and_save_downloads_by_country", | ||
| ), | ||
| ] | ||
| ) | ||
| ) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.