Skip to content

Commit 8fa2e80

Browse files
committed
Update Examples page
1 parent c249e1b commit 8fa2e80

File tree

1 file changed

+17
-53
lines changed

1 file changed

+17
-53
lines changed

docs/examples/index.qmd

Lines changed: 17 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -45,57 +45,8 @@ validation = (
4545
print(validation.get_json_report())
4646
```
4747

48-
Preview a table (any type) and get a consistent view of the data no matter what type of table it is.
49-
This is good for getting your bearings on a new dataset.
50-
51-
```{python}
52-
import pointblank as pb
53-
54-
data = pb.load_dataset(dataset="game_revenue", tbl_type="duckdb")
55-
56-
pb.preview(data=data)
57-
```
58-
59-
### Perform a more comprehensive data validation with sample data
60-
61-
The validation plan can be quite large if you want it to be. Here is validation of the `penguins`
62-
dataset as a DuckDB table.
63-
64-
```{python}
65-
import pointblank as pb
66-
import ibis
67-
68-
con = ibis.connect("duckdb://penguins.ddb")
69-
con.create_table(
70-
"penguins", ibis.examples.penguins.fetch().to_pyarrow(), overwrite=True
71-
)
72-
73-
penguins = con.table("penguins")
74-
75-
validation = (
76-
pb.Validate(
77-
data=penguins,
78-
tbl_name="penguins",
79-
label="The penguins dataset"
80-
)
81-
.col_vals_gt(columns="body_mass_g", value=1000000)
82-
.col_vals_lt(columns="year", value=2024)
83-
.col_vals_eq(columns="year", value=2007)
84-
.col_vals_ne(columns="year", value=2007)
85-
.col_vals_ge(columns="year", value=2007)
86-
.col_vals_regex(columns="sex", pattern="fe")
87-
.col_exists(columns="body_mass_g")
88-
.col_vals_in_set(columns="year", set=[2020, 2018])
89-
.col_vals_not_in_set(columns="year", set=[2010, 2011])
90-
.col_vals_between(columns="year", left=2007, right=2010)
91-
.col_vals_outside(columns="year", left=2008, right=2013)
92-
.interrogate()
93-
)
94-
95-
validation
96-
```
97-
98-
We can use the `pre=` argument to mutate table for a specific validation step.
48+
We can use the `pre=` argument (available in every validation method) to mutate table for a specific
49+
validation step.
9950

10051
```{python}
10152
import polars as pl
@@ -134,8 +85,21 @@ validation = (
13485
validation
13586
```
13687

137-
The following validation plan (collection of validation steps) is even larger. Here, in two
138-
different validation step, we use the `pre=` argument to mutate the target table with a lambda.
88+
Preview a table (any type) and get a consistent view of the data no matter what type of table it is.
89+
This is good for getting your bearings on a new dataset.
90+
91+
```{python}
92+
import pointblank as pb
93+
94+
data = pb.load_dataset(dataset="game_revenue", tbl_type="duckdb")
95+
96+
pb.preview(data=data)
97+
```
98+
99+
### Perform a more comprehensive data validation with sample data
100+
101+
The validation plan can be quite large if you want it to be. Here, in two different validation
102+
steps, we use the `pre=` argument to mutate the target table with a lambda.
139103

140104
```{python}
141105
import pointblank as pb

0 commit comments

Comments
 (0)