You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/backends.md
+17-16Lines changed: 17 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,23 +9,22 @@ The backend determines how data is stored and transformed:
9
9
-**PolarsBackend** (default): Operates on Polars DataFrames using native Polars expressions
10
10
-**DuckDBBackend** (optional): Operates on DuckDB relations using SQL generation
11
11
12
-
All operations, validation, dry-run, and serialization work identically regardless of backend. Pipelines serialized with one backend can be loaded and executed with another.
12
+
A `TransformPlan` is a pure, backend-agnostic recipe of operations. The backend is chosen at execution time by passing it to `process()`, `validate()`, or `dry_run()`. If no backend is specified, `PolarsBackend` is used by default. Pipelines serialized with one backend can be loaded and executed with another.
13
13
14
14
```python
15
15
from transformplan import TransformPlan
16
16
17
-
#Default — uses PolarsBackend
18
-
plan = TransformPlan()
17
+
#Build a plan — no backend needed
18
+
plan = TransformPlan().col_drop("temp").math_add("age", 1)
19
19
20
-
# Explicit Polars backend
21
-
from transformplan.backends.polars import PolarsBackend
22
-
plan = TransformPlan(backend=PolarsBackend())
20
+
# Execute with default PolarsBackend
21
+
result, protocol = plan.process(polars_df)
23
22
24
-
# DuckDB backend
23
+
#Execute with DuckDB backend
25
24
import duckdb
26
25
from transformplan.backends.duckdb import DuckDBBackend
Copy file name to clipboardExpand all lines: docs/api/plan.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ The main class for building and executing transformation pipelines.
4
4
5
5
## Overview
6
6
7
-
`TransformPlan` uses a deferred execution model: operations are registered via method chaining, then executed together when you call `process()`, `validate()`, or `dry_run()`. An optional `backend` parameter selects the execution engine (defaults to `PolarsBackend`).
7
+
`TransformPlan` uses a deferred execution model: operations are registered via method chaining, then executed together when you call `process()`, `validate()`, or `dry_run()`. The plan itself is backend-agnostic — the backend is chosen at execution time (defaults to `PolarsBackend`).
Copy file name to clipboardExpand all lines: docs/getting-started/quickstart.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ print(df_result)
74
74
75
75
## Using the DuckDB Backend
76
76
77
-
TransformPlan supports DuckDB as an alternative backend. All 88 operations, validation, and dry-run work identically — only the data type changes from Polars DataFrames to DuckDB relations.
77
+
TransformPlan supports DuckDB as an alternative backend. All 88 operations, validation, and dry-run work identically — the same plan works with both Polars DataFrames and DuckDB relations. Simply pass the backend at execution time:
0 commit comments