Skip to content

Commit 65717bb

Browse files
committed
Update selector example to include Narwhals selectors
1 parent a39a391 commit 65717bb

File tree

1 file changed

+10
-0
lines changed
  • docs/demos/column-selector-functions

1 file changed

+10
-0
lines changed

docs/demos/column-selector-functions/index.qmd

+10
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Use column selector functions in the `columns=` argument to conveniently choose
1414
#| echo: false
1515
1616
import pointblank as pb
17+
import narwhals.selectors as ncs
1718
1819
validation = (
1920
pb.Validate(
@@ -30,6 +31,10 @@ validation = (
3031
.col_vals_not_null(
3132
columns=pb.last_n(2) # check that the last two columns don't have Null values
3233
)
34+
.col_vals_regex(
35+
columns=ncs.string(), # check that all string columns are non-empty strings
36+
pattern=r"(.|\s)*\S(.|\s)*"
37+
)
3338
.interrogate()
3439
)
3540
@@ -38,6 +43,7 @@ validation
3843

3944
```python
4045
import pointblank as pb
46+
import narwhals.selectors as ncs
4147

4248
validation = (
4349
pb.Validate(
@@ -54,6 +60,10 @@ validation = (
5460
.col_vals_not_null(
5561
columns=pb.last_n(2) # check that the last two columns don't have Null values
5662
)
63+
.col_vals_regex(
64+
columns=ncs.string(), # check that all string columns are non-empty strings
65+
pattern=r"(.|\s)*\S(.|\s)*"
66+
)
5767
.interrogate()
5868
)
5969

0 commit comments

Comments
 (0)