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

docs: Fix the documentation to run the tutorial Validating historical features with Great Expectations #3540

Merged
merged 1 commit into from
Apr 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/tutorials/validating-historical-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ taxi_entity = Entity(name='taxi', join_keys=['taxi_id'])
```python
trips_stats_fv = BatchFeatureView(
name='trip_stats',
entities=['taxi'],
features=[
entities=[taxi_entity],
schema=[
Field(name="total_miles_travelled", dtype=Float64),
Field(name="total_trip_seconds", dtype=Float64),
Field(name="total_earned", dtype=Float64),
Expand All @@ -154,17 +154,17 @@ trips_stats_fv = BatchFeatureView(

```python
@on_demand_feature_view(
schema=[
Field("avg_fare", Float64),
Field("avg_speed", Float64),
Field("avg_trip_seconds", Float64),
Field("earned_per_hour", Float64),
],
sources=[
trips_stats_fv,
],
schema=[
Field(name="avg_fare", dtype=Float64),
Field(name="avg_speed", dtype=Float64),
Field(name="avg_trip_seconds", dtype=Float64),
Field(name="earned_per_hour", dtype=Float64),
]
)
def on_demand_stats(inp):
def on_demand_stats(inp: pd.DataFrame) -> pd.DataFrame:
out = pd.DataFrame()
out["avg_fare"] = inp["total_earned"] / inp["trip_count"]
out["avg_speed"] = 3600 * inp["total_miles_travelled"] / inp["total_trip_seconds"]
Expand Down Expand Up @@ -647,7 +647,7 @@ Now we can create validation reference from dataset and profiler function:


```python
validation_reference = ds.as_reference(profiler=stats_profiler)
validation_reference = ds.as_reference(name="validation_reference_dataset", profiler=stats_profiler)
```

and test it against our existing retrieval job
Expand Down