Skip to content

Commit

Permalink
Replaced CSVDataSet with CSVDataset ; Expanded e2e to 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
SiddhantSadangi committed Nov 9, 2023
1 parent a82381e commit 90a4cec
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
max-parallel: 4
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.7, 3.8, 3.9, "3.10"]
python-version: [3.8, 3.9, "3.10", "3.11"]
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion examples/planets/conf/base/catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# Documentation for this file format can be found in "The Data Catalog"
# Link: https://kedro.readthedocs.io/en/stable/data/data_catalog.html
planets:
type: pandas.CSVDataSet
type: pandas.CSVDataset
filepath: data/planets/planets.csv
21 changes: 16 additions & 5 deletions examples/planets/src/planets/pipelines/furthest_planet.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
Dict,
)

import neptune
import pandas as pd
from kedro.pipeline import (
Pipeline,
node,
)
from neptune import new as neptune


# ------ Looking for furthest planet -------
Expand All @@ -22,15 +22,19 @@ def distances(planets: pd.DataFrame) -> Any:
def furthest(distances_to_planets: pd.DataFrame) -> Dict[str, Any]:
furthest_planet = distances_to_planets.iloc[distances_to_planets["Distance from Sun"].argmax()]
return dict(
furthest_planet_name=furthest_planet.Planet, furthest_planet_distance=furthest_planet["Distance from Sun"]
furthest_planet_name=furthest_planet.Planet,
furthest_planet_distance=furthest_planet["Distance from Sun"],
)


def travel_time(furthest_planet_distance: float, furthest_planet_name: str, travel_speed: float) -> float:
travel_hours = furthest_planet_distance / travel_speed

neptune_run = neptune.init_run(
capture_stdout=False, capture_stderr=False, capture_hardware_metrics=False, source_files=[]
capture_stdout=False,
capture_stderr=False,
capture_hardware_metrics=False,
source_files=[],
)

neptune_run["furthest_planet/name"] = furthest_planet_name
Expand All @@ -56,12 +60,19 @@ def create_pipeline(**kwargs):
node(
furthest,
["distances_to_planets"],
dict(furthest_planet_name="furthest_planet_name", furthest_planet_distance="furthest_planet_distance"),
dict(
furthest_planet_name="furthest_planet_name",
furthest_planet_distance="furthest_planet_distance",
),
name="furthest",
),
node(
travel_time,
["furthest_planet_distance", "furthest_planet_name", "params:travel_speed"],
[
"furthest_planet_distance",
"furthest_planet_name",
"params:travel_speed",
],
"travel_hours",
name="travel_time",
),
Expand Down

0 comments on commit 90a4cec

Please sign in to comment.