Skip to content

Commit

Permalink
Fix demo-project to work with kedro-datasets 2.0 (#1683)
Browse files Browse the repository at this point in the history
Fix demo-project to work with kedro-datasets 2.0
  • Loading branch information
rashidakanchwala authored Dec 18, 2023
1 parent 6547213 commit a012d08
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 36 deletions.
6 changes: 3 additions & 3 deletions demo-project/conf/base/catalog_01_raw.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
companies:
type: pandas.CSVDataSet
type: pandas.CSVDataset
filepath: ${_base_location}/01_raw/companies.csv
metadata:
kedro-viz:
Expand All @@ -8,7 +8,7 @@ companies:
nrows: 5

reviews:
type: pandas.CSVDataSet
type: pandas.CSVDataset
filepath: ${_base_location}/01_raw/reviews.csv
metadata:
kedro-viz:
Expand All @@ -18,7 +18,7 @@ reviews:


shuttles:
type: pandas.ExcelDataSet
type: pandas.ExcelDataset
filepath: ${_base_location}/01_raw/shuttles.xlsx
metadata:
kedro-viz:
Expand Down
8 changes: 4 additions & 4 deletions demo-project/conf/base/catalog_02_int.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
ingestion.int_typed_companies:
type: pandas.ParquetDataSet
type: pandas.ParquetDataset
filepath: ${_base_location}/02_intermediate/typed_companies.pq
metadata:
kedro-viz:
layer: intermediate

ingestion.int_typed_shuttles@pandas1:
type: pandas.ParquetDataSet
type: pandas.ParquetDataset
filepath: ${_base_location}/02_intermediate/typed_shuttles.pq
metadata:
kedro-viz:
layer: intermediate

ingestion.int_typed_shuttles@pandas2:
type: pandas.ParquetDataSet
type: pandas.ParquetDataset
filepath: ${_base_location}/02_intermediate/typed_shuttles.pq
metadata:
kedro-viz:
layer: intermediate

ingestion.int_typed_reviews:
type: pandas.ParquetDataSet
type: pandas.ParquetDataset
filepath: ${_base_location}/02_intermediate/typed_reviews.pq
metadata:
kedro-viz:
Expand Down
4 changes: 2 additions & 2 deletions demo-project/conf/base/catalog_03_prm.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
prm_shuttle_company_reviews:
type: pandas.ParquetDataSet
type: pandas.ParquetDataset
filepath: ${_base_location}/03_primary/prm_shuttle_company_reviews.pq
metadata:
kedro-viz:
layer: primary

prm_spine_table:
type: pandas.ParquetDataSet
type: pandas.ParquetDataset
filepath: ${_base_location}/03_primary/prm_spine_table.pq
metadata:
kedro-viz:
Expand Down
4 changes: 2 additions & 2 deletions demo-project/conf/base/catalog_04_feature.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Use dataset factories to reduce duplication
"feature_engineering.feat_{metric_type}_metrics":
type: pandas.ParquetDataSet
type: pandas.ParquetDataset
filepath: ${_base_location}/04_feature/feat_{metric_type}_metrics.pq
layer: feature

feature_importance_output:
type: pandas.CSVDataSet
type: pandas.CSVDataset
filepath: ${_base_location}/04_feature/feature_importance_output.csv
metadata:
kedro-viz:
Expand Down
2 changes: 1 addition & 1 deletion demo-project/conf/base/catalog_05_model_input.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
model_input_table:
type: pandas.ParquetDataSet
type: pandas.ParquetDataset
filepath: ${_base_location}/05_model_input/model_input_table.pq
metadata:
kedro-viz:
Expand Down
4 changes: 2 additions & 2 deletions demo-project/conf/base/catalog_06_models.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
train_evaluation.linear_regression.regressor:
type: pickle.PickleDataSet
type: pickle.PickleDataset
filepath: ${_base_location}/06_models/linear_regression.pkl
versioned: True

train_evaluation.random_forest.regressor:
type: pickle.PickleDataSet
type: pickle.PickleDataset
filepath: ${_base_location}/06_models/random_forest.pkl
versioned: True
8 changes: 4 additions & 4 deletions demo-project/conf/base/catalog_08_reporting.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
reporting.cancellation_policy_breakdown:
type: plotly.PlotlyDataSet # Constructed via plotly_args below
type: plotly.PlotlyDataset # Constructed via plotly_args below
filepath: ${_base_location}/08_reporting/cancellation_breakdown.json
metadata:
kedro-viz:
Expand All @@ -15,23 +15,23 @@ reporting.cancellation_policy_breakdown:
price: 'fleet_price'

reporting.price_histogram:
type: plotly.JSONDataSet # Constructed via Python API
type: plotly.JSONDataset # Constructed via Python API
filepath: ${_base_location}/08_reporting/price_histogram.json
metadata:
kedro-viz:
layer: reporting
versioned: true

reporting.feature_importance:
type: plotly.JSONDataSet # Constructed via Python API
type: plotly.JSONDataset # Constructed via Python API
filepath: ${_base_location}/08_reporting/feature_importance_plot.json
metadata:
kedro-viz:
layer: reporting
versioned: true

reporting.cancellation_policy_grid:
type: demo_project.extras.datasets.image_dataset.ImageDataSet
type: demo_project.extras.datasets.image_dataset.ImageDataset
filepath: ${_base_location}/08_reporting/cancellation_policy_grid.png

reporting.confusion_matrix:
Expand Down
8 changes: 4 additions & 4 deletions demo-project/conf/base/catalog_09_tracking.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
train_evaluation.linear_regression.r2_score:
type: tracking.MetricsDataSet
type: tracking.MetricsDataset
filepath: ${_base_location}/09_tracking/linear_score.json
versioned: True

train_evaluation.random_forest.r2_score:
type: tracking.MetricsDataSet
type: tracking.MetricsDataset
filepath: ${_base_location}/09_tracking/rf_score.json
versioned: True

train_evaluation.linear_regression.experiment_params:
type: tracking.JSONDataSet
type: tracking.JSONDataset
filepath: ${_base_location}/09_tracking/linear_params.json
versioned: True

train_evaluation.random_forest.experiment_params:
type: tracking.JSONDataSet
type: tracking.JSONDataset
filepath: ${_base_location}/09_tracking/rf_params.json
versioned: True
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from PIL import Image


class ImageDataSet(AbstractDataset):
class ImageDataset(AbstractDataset):
"""``ImageDataSet`` loads / save image data from a given filepath as `numpy` array
using Pillow.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion demo-project/src/demo_project/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jupyter~=1.0
jupyter_client>=5.1, <7.0
jupyterlab~=3.0
kedro~=0.18.0
kedro-datasets[pandas.CSVDataSet,pandas.ExcelDataSet, pandas.ParquetDataSet, plotly.PlotlyDataSet]<=2.0.0
kedro-datasets[pandas.CSVDataset,pandas.ExcelDataset, pandas.ParquetDataset, plotly.PlotlyDataset]<=2.0.0
nbstripout~=0.4
pytest-cov~=2.5
pytest-mock>=1.7.1, <2.0
Expand Down
2 changes: 1 addition & 1 deletion demo-project/src/docker_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kedro>=0.18.0
kedro-datasets[pandas.CSVDataSet,pandas.ExcelDataSet, pandas.ParquetDataSet, plotly.PlotlyDataSet, matplotlib.MatplotlibWriter]<=2.0.0
kedro-datasets[pandas.CSVDataset,pandas.ExcelDataset, pandas.ParquetDataset, plotly.PlotlyDataset, matplotlib.MatplotlibWriter]<=2.0.0
scikit-learn~=1.0
pillow~=9.0
seaborn~=0.11.2

0 comments on commit a012d08

Please sign in to comment.