Skip to main content

adjust-table

Adjust a working dlt SQL database pipeline for production — remove dev limits, add incremental loading, configure merge keys. Use when the user wants to remove .add_limit(), load the full table, or set up incremental loading on a cursor column. For speed/memory tuning (backend, chunk size, parallelism) use optimize-sql-performance instead. For inspecting loaded data or fixing column types/schema after a load, use validate-data instead.

소스 정보

저장소
dlt-hub/dlthub-ai-workbench
최근 소스 활동
2026년 7월 8일 08:24
감지된 SKILL.md 언어
영어
스타
53
포크
5

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
adjust-table
description
Adjust a working dlt SQL database pipeline for production — remove dev limits, add incremental loading, configure merge keys. Use when the user wants to remove .add_limit(), load the full table, or set up incremental loading on a cursor column. For speed/memory tuning (backend, chunk size, parallelism) use optimize-sql-performance instead. For inspecting loaded data or fixing column types/schema after a load, use validate-data instead.
argument-hint
[pipeline-name] [adjustments]
# Adjust table loading for production Parse `$ARGUMENTS`: - `pipeline-name` (optional): the dlt pipeline name. If omitted, infer from session context. If ambiguous, ask the user and stop. - `hints` (optional, after `--`): specific adjustments (e.g. "add incremental on updated_at", "remove limit") ## Critical rule: verify the table before removing `.add_limit()` `.add_limit(1)` during development loads one chunk only — a broken setup (wrong column types, large blobs) won't surface until you load the full table. Before removing it: 1. Run `validate-data` to confirm the schema and sample data look correct. 2. Check the table's row count so you know what to expect. 3. For large tables (>1M rows), consider adding incremental loading first. ## Remove dev settings Once the test run is validated, remove the development flags: ```python pipeline = dlt.pipeline( pipeline_name="<name>", destination="<destination>", dataset_name="<name>", # dev_mode=True, # remove — write to the fixed dataset name # progress="log", # remove — or keep if the user wants it ) load_info = pipeline.run(table, write_disposition="replace") # remove .add_limit(1) ``` ## Add incremental loading Incremental loading fetches only new or updated rows on each run using a cursor column. **Ref:** https://dlthub.com/docs/dlt-ecosystem/verified-sources/sql_database/configuration#incremental-loading ```python import dlt from dlt.sources.sql_database import sql_table table = sql_table( table="<table_name>", incremental=dlt.sources.incremental( "<cursor_column>", # e.g. "updated_at" or "id" initial_value="2020-01-01T00:00:00Z", # where to start on the first run ), ) pipeline.run(table, write_disposition="merge", primary_key="<pk_column>") ``` Key decisions: - **Cursor column**: prefer `updated_at` / `modified_at` for change tracking; `id` for append-only tables - **`write_disposition="merge"`**: required with incremental — replaces rows with matching primary key - **`primary_key`**: set this to the table's primary key so upserts work correctly - **`initial_value`**: where to start on the very first run — older values are excluded Check stored cursor state between runs: ``` uv run dlthub local pipeline info <pipeline_name> -v ``` Look for `last_value` in the resource state. Ref: https://dlthub.com/docs/general-usage/incremental/troubleshooting.md ## Run the first full load ``` uv run python <name>_pipeline.py ``` Use `debug-pipeline` to inspect the first full run — large tables can surface new issues (timeouts, type errors on edge-case values, memory pressure). ## Next steps - **Full load complete** → hand over to **data-exploration** toolkit or **dlthub-platform** to deploy - **Slow or memory-heavy load** → use `optimize-sql-performance` (backend, chunk size, parallel tables, push-down) - **Errors on full load** → use `debug-pipeline` - **Need more tables** → use `add-table`
GitHub에서 보기