@@ -2858,32 +2858,30 @@ def send_report():
2858
2858
2859
2859
### Working with Database Connection Strings
2860
2860
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:
2864
2863
2865
2864
```{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
+
2867
2868
validation_9 = (
2868
2869
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"
2871
2872
)
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)
2874
2875
.interrogate()
2875
2876
)
2876
2877
2877
2878
validation_9
2878
2879
```
2879
2880
2880
2881
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.
2887
2885
"""
2888
2886
2889
2887
data: FrameT | Any
0 commit comments