dbt-cube-sync 0.1.0a7__tar.gz → 0.1.0a8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dbt-cube-sync might be problematic. Click here for more details.
- {dbt_cube_sync-0.1.0a7 → dbt_cube_sync-0.1.0a8}/PKG-INFO +100 -19
- {dbt_cube_sync-0.1.0a7 → dbt_cube_sync-0.1.0a8}/README.md +99 -18
- dbt_cube_sync-0.1.0a8/dbt_cube_sync/cli.py +516 -0
- {dbt_cube_sync-0.1.0a7 → dbt_cube_sync-0.1.0a8}/dbt_cube_sync/core/cube_generator.py +14 -10
- dbt_cube_sync-0.1.0a8/dbt_cube_sync/core/db_inspector.py +97 -0
- {dbt_cube_sync-0.1.0a7 → dbt_cube_sync-0.1.0a8}/dbt_cube_sync/core/dbt_parser.py +74 -8
- {dbt_cube_sync-0.1.0a7 → dbt_cube_sync-0.1.0a8}/dbt_cube_sync/core/models.py +17 -1
- dbt_cube_sync-0.1.0a8/dbt_cube_sync/core/state_manager.py +221 -0
- {dbt_cube_sync-0.1.0a7 → dbt_cube_sync-0.1.0a8}/pyproject.toml +1 -1
- dbt_cube_sync-0.1.0a7/dbt_cube_sync/cli.py +0 -168
- dbt_cube_sync-0.1.0a7/dbt_cube_sync/core/db_inspector.py +0 -112
- {dbt_cube_sync-0.1.0a7 → dbt_cube_sync-0.1.0a8}/dbt_cube_sync/__init__.py +0 -0
- {dbt_cube_sync-0.1.0a7 → dbt_cube_sync-0.1.0a8}/dbt_cube_sync/config.py +0 -0
- {dbt_cube_sync-0.1.0a7 → dbt_cube_sync-0.1.0a8}/dbt_cube_sync/connectors/__init__.py +0 -0
- {dbt_cube_sync-0.1.0a7 → dbt_cube_sync-0.1.0a8}/dbt_cube_sync/connectors/base.py +0 -0
- {dbt_cube_sync-0.1.0a7 → dbt_cube_sync-0.1.0a8}/dbt_cube_sync/connectors/powerbi.py +0 -0
- {dbt_cube_sync-0.1.0a7 → dbt_cube_sync-0.1.0a8}/dbt_cube_sync/connectors/superset.py +0 -0
- {dbt_cube_sync-0.1.0a7 → dbt_cube_sync-0.1.0a8}/dbt_cube_sync/connectors/tableau.py +0 -0
- {dbt_cube_sync-0.1.0a7 → dbt_cube_sync-0.1.0a8}/dbt_cube_sync/core/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dbt-cube-sync
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0a8
|
|
4
4
|
Summary: Synchronization tool for dbt models to Cube.js schemas and BI tools
|
|
5
5
|
Author: Ponder
|
|
6
6
|
Requires-Python: >=3.9,<4.0
|
|
@@ -144,34 +144,101 @@ connectors:
|
|
|
144
144
|
|
|
145
145
|
## CLI Commands
|
|
146
146
|
|
|
147
|
+
### Quick Reference
|
|
148
|
+
|
|
149
|
+
| Command | Description |
|
|
150
|
+
|---------|-------------|
|
|
151
|
+
| `sync-all` | **Ultimate command** - Incremental sync: dbt → Cube.js → Superset → RAG |
|
|
152
|
+
| `dbt-to-cube` | Generate Cube.js schemas from dbt models (with incremental support) |
|
|
153
|
+
| `cube-to-bi` | Sync Cube.js schemas to BI tools (Superset, Tableau, PowerBI) |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
### `sync-all` (Recommended)
|
|
158
|
+
|
|
159
|
+
**Ultimate incremental sync command** - handles the complete pipeline with state tracking.
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# Basic incremental sync (Cube.js only)
|
|
163
|
+
dbt-cube-sync sync-all -m manifest.json -c catalog.json -o ./cube_output
|
|
164
|
+
|
|
165
|
+
# Full pipeline: dbt → Cube.js → Superset
|
|
166
|
+
dbt-cube-sync sync-all -m manifest.json -c catalog.json -o ./cube_output \
|
|
167
|
+
--superset-url http://localhost:8088 \
|
|
168
|
+
--superset-username admin \
|
|
169
|
+
--superset-password admin
|
|
170
|
+
|
|
171
|
+
# Full pipeline: dbt → Cube.js → Superset → RAG embeddings
|
|
172
|
+
dbt-cube-sync sync-all -m manifest.json -c catalog.json -o ./cube_output \
|
|
173
|
+
--superset-url http://localhost:8088 \
|
|
174
|
+
--superset-username admin \
|
|
175
|
+
--superset-password admin \
|
|
176
|
+
--rag-api-url http://localhost:8000
|
|
177
|
+
|
|
178
|
+
# Force full rebuild (ignore state)
|
|
179
|
+
dbt-cube-sync sync-all -m manifest.json -c catalog.json -o ./cube_output --force-full-sync
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**Options:**
|
|
183
|
+
| Option | Required | Description |
|
|
184
|
+
|--------|----------|-------------|
|
|
185
|
+
| `--manifest, -m` | Yes | Path to dbt manifest.json |
|
|
186
|
+
| `--catalog, -c` | No* | Path to dbt catalog.json |
|
|
187
|
+
| `--sqlalchemy-uri, -s` | No* | Database URI for column types |
|
|
188
|
+
| `--output, -o` | Yes | Output directory for Cube.js files |
|
|
189
|
+
| `--state-path` | No | State file path (default: `.dbt-cube-sync-state.json`) |
|
|
190
|
+
| `--force-full-sync` | No | Force full rebuild, ignore state |
|
|
191
|
+
| `--superset-url` | No | Superset URL |
|
|
192
|
+
| `--superset-username` | No | Superset username |
|
|
193
|
+
| `--superset-password` | No | Superset password |
|
|
194
|
+
| `--cube-connection-name` | No | Cube database name in Superset (default: `Cube`) |
|
|
195
|
+
| `--rag-api-url` | No | RAG API URL for embedding updates |
|
|
196
|
+
|
|
197
|
+
*Either `--catalog` or `--sqlalchemy-uri` is required.
|
|
198
|
+
|
|
199
|
+
**How Incremental Sync Works:**
|
|
200
|
+
1. Reads state file (`.dbt-cube-sync-state.json`) with model checksums
|
|
201
|
+
2. Compares against current manifest to detect changes
|
|
202
|
+
3. Only processes **added** or **modified** models
|
|
203
|
+
4. Deletes Cube.js files for **removed** models
|
|
204
|
+
5. Updates state file with new checksums
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
147
208
|
### `dbt-to-cube`
|
|
148
|
-
|
|
209
|
+
|
|
210
|
+
Generate Cube.js schema files from dbt models with incremental support.
|
|
149
211
|
|
|
150
212
|
**Options:**
|
|
151
213
|
- `--manifest` / `-m`: Path to dbt manifest.json file (required)
|
|
152
|
-
- `--catalog` / `-c`: Path to dbt catalog.json file
|
|
153
|
-
- `--sqlalchemy-uri` / `-s`: SQLAlchemy database URI for fetching column types
|
|
154
|
-
|
|
155
|
-
- Example: `mysql://user:password@localhost:3306/database`
|
|
156
|
-
- Example: `snowflake://user:password@account/database/schema`
|
|
157
|
-
- `--models`: Comma-separated list of model names to process (optional, processes all if not specified)
|
|
158
|
-
- Example: `--models model1,model2,model3`
|
|
214
|
+
- `--catalog` / `-c`: Path to dbt catalog.json file
|
|
215
|
+
- `--sqlalchemy-uri` / `-s`: SQLAlchemy database URI for fetching column types
|
|
216
|
+
- `--models`: Comma-separated list of model names to process
|
|
159
217
|
- `--output` / `-o`: Output directory for Cube.js files (required)
|
|
160
218
|
- `--template-dir` / `-t`: Directory containing Cube.js templates (default: ./cube/templates)
|
|
219
|
+
- `--state-path`: State file for incremental sync (default: `.dbt-cube-sync-state.json`)
|
|
220
|
+
- `--force-full-sync`: Force full regeneration, ignore cached state
|
|
221
|
+
- `--no-state`: Disable state tracking (legacy behavior)
|
|
161
222
|
|
|
162
223
|
**Examples:**
|
|
163
224
|
```bash
|
|
164
|
-
#
|
|
225
|
+
# Incremental sync (default)
|
|
165
226
|
dbt-cube-sync dbt-to-cube -m manifest.json -c catalog.json -o output/
|
|
166
227
|
|
|
228
|
+
# Force full rebuild
|
|
229
|
+
dbt-cube-sync dbt-to-cube -m manifest.json -c catalog.json -o output/ --force-full-sync
|
|
230
|
+
|
|
167
231
|
# Using database connection (no catalog needed)
|
|
168
232
|
dbt-cube-sync dbt-to-cube -m manifest.json -s postgresql://user:pass@localhost/db -o output/
|
|
169
233
|
|
|
170
234
|
# Filter specific models
|
|
171
|
-
dbt-cube-sync dbt-to-cube -m manifest.json -
|
|
235
|
+
dbt-cube-sync dbt-to-cube -m manifest.json -c catalog.json -o output/ --models users,orders
|
|
172
236
|
```
|
|
173
237
|
|
|
238
|
+
---
|
|
239
|
+
|
|
174
240
|
### `cube-to-bi`
|
|
241
|
+
|
|
175
242
|
Sync Cube.js schemas to BI tool datasets.
|
|
176
243
|
|
|
177
244
|
**Arguments:**
|
|
@@ -189,15 +256,29 @@ Sync Cube.js schemas to BI tool datasets.
|
|
|
189
256
|
dbt-cube-sync cube-to-bi superset -c cube_output/ -u http://localhost:8088 -n admin -p admin -d Cube
|
|
190
257
|
```
|
|
191
258
|
|
|
192
|
-
|
|
193
|
-
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## State File
|
|
262
|
+
|
|
263
|
+
The state file (`.dbt-cube-sync-state.json`) tracks:
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"version": "1.0",
|
|
268
|
+
"last_sync_timestamp": "2024-01-15T10:30:00Z",
|
|
269
|
+
"manifest_path": "/path/to/manifest.json",
|
|
270
|
+
"models": {
|
|
271
|
+
"model.project.users": {
|
|
272
|
+
"checksum": "abc123...",
|
|
273
|
+
"has_metrics": true,
|
|
274
|
+
"last_generated": "2024-01-15T10:30:00Z",
|
|
275
|
+
"output_file": "./cube_output/Users.js"
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
```
|
|
194
280
|
|
|
195
|
-
|
|
196
|
-
- `--dbt-manifest` / `-m`: Path to dbt manifest.json file
|
|
197
|
-
- `--cube-dir` / `-c`: Directory for Cube.js files
|
|
198
|
-
- `--template-dir` / `-t`: Directory containing Cube.js templates
|
|
199
|
-
- `--bi-connector` / `-b`: BI tool to sync to
|
|
200
|
-
- `--config-file` / `-f`: Configuration file for BI tool connection
|
|
281
|
+
Delete this file to force a full rebuild, or use `--force-full-sync`.
|
|
201
282
|
|
|
202
283
|
## Architecture
|
|
203
284
|
|
|
@@ -123,34 +123,101 @@ connectors:
|
|
|
123
123
|
|
|
124
124
|
## CLI Commands
|
|
125
125
|
|
|
126
|
+
### Quick Reference
|
|
127
|
+
|
|
128
|
+
| Command | Description |
|
|
129
|
+
|---------|-------------|
|
|
130
|
+
| `sync-all` | **Ultimate command** - Incremental sync: dbt → Cube.js → Superset → RAG |
|
|
131
|
+
| `dbt-to-cube` | Generate Cube.js schemas from dbt models (with incremental support) |
|
|
132
|
+
| `cube-to-bi` | Sync Cube.js schemas to BI tools (Superset, Tableau, PowerBI) |
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### `sync-all` (Recommended)
|
|
137
|
+
|
|
138
|
+
**Ultimate incremental sync command** - handles the complete pipeline with state tracking.
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Basic incremental sync (Cube.js only)
|
|
142
|
+
dbt-cube-sync sync-all -m manifest.json -c catalog.json -o ./cube_output
|
|
143
|
+
|
|
144
|
+
# Full pipeline: dbt → Cube.js → Superset
|
|
145
|
+
dbt-cube-sync sync-all -m manifest.json -c catalog.json -o ./cube_output \
|
|
146
|
+
--superset-url http://localhost:8088 \
|
|
147
|
+
--superset-username admin \
|
|
148
|
+
--superset-password admin
|
|
149
|
+
|
|
150
|
+
# Full pipeline: dbt → Cube.js → Superset → RAG embeddings
|
|
151
|
+
dbt-cube-sync sync-all -m manifest.json -c catalog.json -o ./cube_output \
|
|
152
|
+
--superset-url http://localhost:8088 \
|
|
153
|
+
--superset-username admin \
|
|
154
|
+
--superset-password admin \
|
|
155
|
+
--rag-api-url http://localhost:8000
|
|
156
|
+
|
|
157
|
+
# Force full rebuild (ignore state)
|
|
158
|
+
dbt-cube-sync sync-all -m manifest.json -c catalog.json -o ./cube_output --force-full-sync
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Options:**
|
|
162
|
+
| Option | Required | Description |
|
|
163
|
+
|--------|----------|-------------|
|
|
164
|
+
| `--manifest, -m` | Yes | Path to dbt manifest.json |
|
|
165
|
+
| `--catalog, -c` | No* | Path to dbt catalog.json |
|
|
166
|
+
| `--sqlalchemy-uri, -s` | No* | Database URI for column types |
|
|
167
|
+
| `--output, -o` | Yes | Output directory for Cube.js files |
|
|
168
|
+
| `--state-path` | No | State file path (default: `.dbt-cube-sync-state.json`) |
|
|
169
|
+
| `--force-full-sync` | No | Force full rebuild, ignore state |
|
|
170
|
+
| `--superset-url` | No | Superset URL |
|
|
171
|
+
| `--superset-username` | No | Superset username |
|
|
172
|
+
| `--superset-password` | No | Superset password |
|
|
173
|
+
| `--cube-connection-name` | No | Cube database name in Superset (default: `Cube`) |
|
|
174
|
+
| `--rag-api-url` | No | RAG API URL for embedding updates |
|
|
175
|
+
|
|
176
|
+
*Either `--catalog` or `--sqlalchemy-uri` is required.
|
|
177
|
+
|
|
178
|
+
**How Incremental Sync Works:**
|
|
179
|
+
1. Reads state file (`.dbt-cube-sync-state.json`) with model checksums
|
|
180
|
+
2. Compares against current manifest to detect changes
|
|
181
|
+
3. Only processes **added** or **modified** models
|
|
182
|
+
4. Deletes Cube.js files for **removed** models
|
|
183
|
+
5. Updates state file with new checksums
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
126
187
|
### `dbt-to-cube`
|
|
127
|
-
|
|
188
|
+
|
|
189
|
+
Generate Cube.js schema files from dbt models with incremental support.
|
|
128
190
|
|
|
129
191
|
**Options:**
|
|
130
192
|
- `--manifest` / `-m`: Path to dbt manifest.json file (required)
|
|
131
|
-
- `--catalog` / `-c`: Path to dbt catalog.json file
|
|
132
|
-
- `--sqlalchemy-uri` / `-s`: SQLAlchemy database URI for fetching column types
|
|
133
|
-
|
|
134
|
-
- Example: `mysql://user:password@localhost:3306/database`
|
|
135
|
-
- Example: `snowflake://user:password@account/database/schema`
|
|
136
|
-
- `--models`: Comma-separated list of model names to process (optional, processes all if not specified)
|
|
137
|
-
- Example: `--models model1,model2,model3`
|
|
193
|
+
- `--catalog` / `-c`: Path to dbt catalog.json file
|
|
194
|
+
- `--sqlalchemy-uri` / `-s`: SQLAlchemy database URI for fetching column types
|
|
195
|
+
- `--models`: Comma-separated list of model names to process
|
|
138
196
|
- `--output` / `-o`: Output directory for Cube.js files (required)
|
|
139
197
|
- `--template-dir` / `-t`: Directory containing Cube.js templates (default: ./cube/templates)
|
|
198
|
+
- `--state-path`: State file for incremental sync (default: `.dbt-cube-sync-state.json`)
|
|
199
|
+
- `--force-full-sync`: Force full regeneration, ignore cached state
|
|
200
|
+
- `--no-state`: Disable state tracking (legacy behavior)
|
|
140
201
|
|
|
141
202
|
**Examples:**
|
|
142
203
|
```bash
|
|
143
|
-
#
|
|
204
|
+
# Incremental sync (default)
|
|
144
205
|
dbt-cube-sync dbt-to-cube -m manifest.json -c catalog.json -o output/
|
|
145
206
|
|
|
207
|
+
# Force full rebuild
|
|
208
|
+
dbt-cube-sync dbt-to-cube -m manifest.json -c catalog.json -o output/ --force-full-sync
|
|
209
|
+
|
|
146
210
|
# Using database connection (no catalog needed)
|
|
147
211
|
dbt-cube-sync dbt-to-cube -m manifest.json -s postgresql://user:pass@localhost/db -o output/
|
|
148
212
|
|
|
149
213
|
# Filter specific models
|
|
150
|
-
dbt-cube-sync dbt-to-cube -m manifest.json -
|
|
214
|
+
dbt-cube-sync dbt-to-cube -m manifest.json -c catalog.json -o output/ --models users,orders
|
|
151
215
|
```
|
|
152
216
|
|
|
217
|
+
---
|
|
218
|
+
|
|
153
219
|
### `cube-to-bi`
|
|
220
|
+
|
|
154
221
|
Sync Cube.js schemas to BI tool datasets.
|
|
155
222
|
|
|
156
223
|
**Arguments:**
|
|
@@ -168,15 +235,29 @@ Sync Cube.js schemas to BI tool datasets.
|
|
|
168
235
|
dbt-cube-sync cube-to-bi superset -c cube_output/ -u http://localhost:8088 -n admin -p admin -d Cube
|
|
169
236
|
```
|
|
170
237
|
|
|
171
|
-
|
|
172
|
-
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## State File
|
|
241
|
+
|
|
242
|
+
The state file (`.dbt-cube-sync-state.json`) tracks:
|
|
243
|
+
|
|
244
|
+
```json
|
|
245
|
+
{
|
|
246
|
+
"version": "1.0",
|
|
247
|
+
"last_sync_timestamp": "2024-01-15T10:30:00Z",
|
|
248
|
+
"manifest_path": "/path/to/manifest.json",
|
|
249
|
+
"models": {
|
|
250
|
+
"model.project.users": {
|
|
251
|
+
"checksum": "abc123...",
|
|
252
|
+
"has_metrics": true,
|
|
253
|
+
"last_generated": "2024-01-15T10:30:00Z",
|
|
254
|
+
"output_file": "./cube_output/Users.js"
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
```
|
|
173
259
|
|
|
174
|
-
|
|
175
|
-
- `--dbt-manifest` / `-m`: Path to dbt manifest.json file
|
|
176
|
-
- `--cube-dir` / `-c`: Directory for Cube.js files
|
|
177
|
-
- `--template-dir` / `-t`: Directory containing Cube.js templates
|
|
178
|
-
- `--bi-connector` / `-b`: BI tool to sync to
|
|
179
|
-
- `--config-file` / `-f`: Configuration file for BI tool connection
|
|
260
|
+
Delete this file to force a full rebuild, or use `--force-full-sync`.
|
|
180
261
|
|
|
181
262
|
## Architecture
|
|
182
263
|
|