Skip to content

Commit 4cfecd6

Browse files
authored
Merge pull request #226 from posit-dev/fix-cli-data-ingest-consistency
fix: ensure that the CLI uses the centralized ingest functionality
2 parents dae3ec9 + f05d924 commit 4cfecd6

16 files changed

Lines changed: 381 additions & 242 deletions

File tree

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,14 @@ Pointblank includes a powerful CLI utility called `pb` that lets you run data va
163163
# Get a quick preview of your data
164164
pb preview small_table
165165

166-
# Check for missing values
167-
pb missing small_table
166+
# Preview data from GitHub URLs
167+
pb preview "https://github.com/user/repo/blob/main/data.csv"
168168

169-
# Generate column summaries
170-
pb scan small_table
169+
# Check for missing values in Parquet files
170+
pb missing data.parquet
171+
172+
# Generate column summaries from database connections
173+
pb scan "duckdb:///data/sales.ddb::customers"
171174
```
172175

173176
**Run Essential Validations**
@@ -176,8 +179,11 @@ pb scan small_table
176179
# Check for duplicate rows
177180
pb validate-simple small_table --check rows-distinct
178181

179-
# Verify no null values
180-
pb validate-simple small_table --check col-vals-not-null --column a
182+
# Validate data directly from GitHub
183+
pb validate-simple "https://github.com/user/repo/blob/main/sales.csv" --check col-vals-not-null --column customer_id
184+
185+
# Verify no null values in Parquet datasets
186+
pb validate-simple "data/*.parquet" --check col-vals-not-null --column a
181187

182188
# Extract failing data for debugging
183189
pb validate-simple small_table --check col-vals-gt --column a --value 5 --show-extract

docs/demos/cli-interactive/index.qmd

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ format:
2323
}
2424
---
2525

26-
# Command Line Interface: Interactive Demos
27-
2826
These CLI demos showcase practical data quality workflows that you can use!
2927

3028
::: {.callout-tip}
@@ -93,49 +91,50 @@ Follow an end-to-end data quality pipeline combining exploration, validation, an
9391

9492
Ready to implement data quality workflows? Here's how to get started:
9593

96-
### 1. Install and Verify
94+
#### 1. Install and Verify
9795

9896
```bash
9997
pip install pointblank
10098
pb --help
10199
```
102100

103-
### 2. Explore Your Data
101+
#### 2. Explore Various Data Sources
104102

105103
```bash
106-
# Get a quick preview of your data
104+
# Built-in datasets
107105
pb preview small_table
108106

109-
# Check for missing values
110-
pb missing small_table
107+
# Local files with patterns
108+
pb preview "data/*.parquet"
109+
pb scan sales_data.csv
110+
111+
# GitHub repositories (no download required)
112+
pb preview "https://github.com/user/repo/blob/main/data.csv"
113+
pb missing "https://raw.githubusercontent.com/user/repo/main/sales.parquet"
111114

112-
# Generate column summaries
113-
pb scan small_table
115+
# Database connections
116+
pb info "duckdb:///warehouse/analytics.ddb::customers"
114117
```
115118

116-
### 3. Run Essential Validations
119+
#### 3. Run Essential Validations
117120

118121
```bash
119122
# Check for duplicate rows
120123
pb validate-simple small_table --check rows-distinct
121124

122-
# Verify no null values
123-
pb validate-simple small_table --check col-vals-not-null --column a
125+
# Validate data from multiple sources
126+
pb validate-simple "data/*.parquet" --check col-vals-not-null --column customer_id
127+
pb validate-simple "https://github.com/user/repo/blob/main/sales.csv" --check rows-distinct
124128

125129
# Extract failing data for debugging
126130
pb validate-simple small_table --check col-vals-gt --column a --value 5 --show-extract
127131
```
128132

129-
### 4. Integrate with CI/CD
133+
#### 4. Integrate with CI/CD
130134

131135
```bash
132136
# Use exit codes for automation (0 = pass, 1 = fail)
133137
pb validate-simple small_table --check rows-distinct && echo "✅ Quality checks passed"
134138
```
135139

136-
::: {.callout-tip}
137-
## Next Steps
138-
- visit the [CLI User Guide](../../user-guide/cli.qmd) for detailed documentation
139-
- use `pb validate-simple --help` for validation command options
140-
- Combine exploration, validation, and profiling for robust data quality pipelines
141-
:::
140+

docs/user-guide/cli.qmd

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,91 @@ You can validate various types of data sources:
4444
pb validate-simple data.csv --check rows-distinct
4545
```
4646

47-
*Parquet files*
47+
*Parquet files (including glob patterns and directories)*
4848

4949
```bash
5050
pb validate-simple data.parquet --check col-vals-not-null --column age
51+
pb validate-simple "data/*.parquet" --check rows-distinct
52+
pb validate-simple data/ --check rows-complete # directory of parquet files
5153
```
5254

53-
*Database tables*
55+
*GitHub URLs (direct links to CSV or Parquet files)*
56+
57+
```bash
58+
pb validate-simple "https://github.com/user/repo/blob/main/data.csv" --check rows-distinct
59+
pb validate-simple "https://raw.githubusercontent.com/user/repo/main/data.parquet" --check col-exists --column id
60+
```
61+
62+
*Database tables (connection strings)*
5463

5564
```bash
5665
pb validate-simple "duckdb:///path/to/db.ddb::table_name" --check rows-complete
5766
```
5867

59-
*built-in datasets*
68+
*Built-in datasets*
6069

6170
```bash
6271
pb validate-simple small_table --check col-exists --column a
6372
```
6473

74+
## Enhanced Data Source Support
75+
76+
The CLI leverages Pointblank's centralized data processing pipeline, providing comprehensive support for various data sources:
77+
78+
### GitHub Integration
79+
80+
Validate data directly from GitHub repositories without downloading files:
81+
82+
```bash
83+
# Standard GitHub URLs (automatically converted to raw URLs)
84+
pb preview "https://github.com/user/repo/blob/main/data.csv"
85+
pb validate-simple "https://github.com/user/repo/blob/main/sales.csv" --check rows-distinct
86+
87+
# Raw GitHub URLs (used directly)
88+
pb scan "https://raw.githubusercontent.com/user/repo/main/data.parquet"
89+
```
90+
91+
### Advanced File Patterns
92+
93+
Support for complex file patterns and directory structures:
94+
95+
```bash
96+
# Glob patterns for multiple files
97+
pb validate-simple "data/*.parquet" --check col-vals-not-null --column id
98+
pb preview "sales_data_*.csv"
99+
100+
# Entire directories of Parquet files
101+
pb scan data/partitioned_dataset/
102+
pb missing warehouse/daily_reports/
103+
104+
# Partitioned datasets (automatically detects partition columns)
105+
pb validate-simple partitioned_sales/ --check rows-distinct
106+
```
107+
108+
### Database Connections
109+
110+
Enhanced support for database connection strings:
111+
112+
```bash
113+
# DuckDB databases with table specification
114+
pb validate-simple "duckdb:///warehouse/analytics.ddb::customer_metrics" --check col-exists --column customer_id
115+
116+
# Preview database tables
117+
pb preview "duckdb:///data/sales.ddb::transactions"
118+
```
119+
120+
### Automatic Data Type Detection
121+
122+
The CLI automatically detects and handles:
123+
124+
- CSV files: single files or glob patterns
125+
- Parquet files: files, patterns, directories, and partitioned datasets
126+
- GitHub URLs: both standard and raw URLs for CSV/Parquet files
127+
- database connections: connection strings with table specifications
128+
- built-in datasets: Pointblank's included sample datasets
129+
130+
This unified approach means you can use the same CLI commands regardless of where your data is stored.
131+
65132
## Available Validation Checks
66133

67134
### Data Completeness

0 commit comments

Comments
 (0)