Skip to content

Commit 7486453

Browse files
committed
Update example in Validate docstring
1 parent fb1ee27 commit 7486453

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

pointblank/validate.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2858,32 +2858,30 @@ def send_report():
28582858

28592859
### Working with Database Connection Strings
28602860

2861-
The `Validate` class supports RFC 3986 URI-formatted database connection strings for direct
2862-
validation of database tables. Connection strings must specify a table using the `::table_name`
2863-
suffix:
2861+
The `Validate` class supports database connection strings for direct validation of database
2862+
tables. Connection strings must specify a table using the `::table_name` suffix:
28642863

28652864
```{python}
2866-
# DuckDB database with table specification
2865+
# Get path to a DuckDB database file from package data
2866+
duckdb_path = pb.get_data_path("game_revenue", "duckdb")
2867+
28672868
validation_9 = (
28682869
pb.Validate(
2869-
data="duckdb:///sales_database.ddb::quarterly_sales",
2870-
label="DuckDB Sales Validation"
2870+
data=f"duckdb:///{duckdb_path}::game_revenue",
2871+
label="DuckDB Game Revenue Validation"
28712872
)
2872-
.col_exists(["quarter", "region", "revenue"])
2873-
.col_vals_gt(columns="revenue", value=0)
2873+
.col_exists(["player_id", "session_id", "item_revenue"])
2874+
.col_vals_gt(columns="item_revenue", value=0)
28742875
.interrogate()
28752876
)
28762877

28772878
validation_9
28782879
```
28792880

28802881
For comprehensive documentation on supported connection string formats, error handling, and
2881-
installation requirements, see the [`connect_to_table()`](`pointblank.connect_to_table`) function.
2882-
2883-
Connection strings work with various database backends including DuckDB, PostgreSQL, MySQL,
2884-
SQLite, BigQuery, and Snowflake. The `connect_to_table()` utility function handles all the
2885-
connection logic and provides helpful error messages when table specifications are missing or
2886-
backend dependencies are not installed.
2882+
installation requirements, see the [`connect_to_table()`](`pointblank.connect_to_table`)
2883+
function. This function handles all the connection logic and provides helpful error messages
2884+
when table specifications are missing or backend dependencies are not installed.
28872885
"""
28882886

28892887
data: FrameT | Any

0 commit comments

Comments
 (0)