An incremental transform in Foundry quietly becomes a full rebuild when one of its requirements fails, according to Palantir's incremental transforms documentation. By default, it does not throw an error.
For Code Repositories builders on large or fast-growing datasets, that fallback decides whether a build processes only new rows or reprocesses everything. This guide follows Palantir's Python documentation step by step.
Palantir announced general availability of the Foundry usage and limits page in Resource Management on November 19, 2026, Foundry News reported. That page does not show all transform compute. Palantir's November announcements say: "It covers only traffic reported through Foundry's rate limits infrastructure and does not represent all compute, storage, or billable usage."
For other usage, Palantir points users to the Overview and Analysis pages, according to the Foundry News report.
Before you start: you need a Python transform that already uses `transform()`, `transform.using()`, `transform_df()` or `transform_pandas()`. Palantir's documentation says: "The compute function for your transform must support being run both incrementally and non-incrementally."
What the decorator decides
The `incremental()` decorator looks up information about the transform's previous build, the documentation says. It uses that information to decide whether the run can be incremental. The signature is:
`transforms.api.incremental(require_incremental=False, semantic_version=1, snapshot_inputs=None, allow_retention=False, allow_user_deletes=False, strict_append=False, v2_semantics=False)`
The documentation sets out these conditions for an incremental run:
- Non-snapshot inputs had only files added since the last run. Deletions from retention are also accepted when you set `allow_retention=True`, and user deletions when you set `allow_user_deletes=True`.
- An input whose last transaction modified existing files, or deleted files those arguments do not permit, runs incrementally only if it is marked as a snapshot input.
- For multi-output transforms, the same transform last built all of the outputs.
You can change the list of inputs. The docs say: "The list of the transform's inputs may be modified without compromising the incrementality of the build."
Make the fallback loud
The docs describe the fallback this way: "If a transform has the incremental() decorator but any of the above requirements are not met, the transform will automatically be run non-incrementally." The default output write mode then switches to replace. Reading from your own output returns an empty dataframe.
To turn that into a visible failure:
- Set `require_incremental=True`. Palantir's documentation says: "Setting the require_incremental argument to True makes the transform fail if it cannot run incrementally."
- Expect two allowed exceptions. A snapshot still runs when an output has never been built, or when the semantic version has changed.
- Set `v2_semantics=True`. Palantir says: "There should be no difference in behavior between v2 and v1 incremental semantics, and we recommend all users set this to True."
Pipeline Builder gained a matching "Require incremental execution" setting in March 2026.
Append versus modify: read and write modes
Inputs have three read modes, according to the documentation:
- added: the rows appended since the last run. This is the default. In a non-incremental run, it returns the whole dataset.
- previous: the entire input from the last run. In a non-incremental run, it returns an empty DataFrame.
- current: the entire input for the current run.
Outputs have two write modes. In modify, the documentation says, writing a DataFrame appends it to the existing output. In replace, the data written during the build fully replaces the output.
Incremental runs default to modify. Non-incremental runs default to replace.
Those defaults fit together. Palantir's example shows a transform that reads `added` and writes in the default mode handling both cases. On a full run it reads all rows and replaces the output; on an incremental run it reads only new rows and appends them.
To change existing rows rather than append, Palantir points to replace mode. You set it with `set_mode()`, which works with `transform()` or `transform.using()`. The docs say to make sure the mode is valid for both kinds of run, and otherwise to use the `is_incremental` property.
Joins, aggregations and snapshot inputs
With `transform_df()` or `transform_pandas()`, the decorator gives you only the default read and write modes. Palantir says that is enough when added output rows depend only on added input rows. For joins, aggregations or distinct, which need you to set the modes yourself, the docs direct you to pair `incremental()` with `transform()`.
Take a join against a reference table that gets fully rewritten. If that table is an ordinary input, a SNAPSHOT transaction on it sends the transform back to a full run. Palantir's docs say: "It is often desirable to allow certain inputs to be fully rewritten without affecting the ability to run the transform incrementally. To do so, configure those inputs as snapshot inputs."
List those inputs in `snapshot_inputs`.
Deletes and retention
By default, any removed-type change in an input forces a snapshot. There are two options:
- `allow_retention=True` keeps incrementality when retention policies delete files in input and output datasets.
- `allow_user_deletes=True` keeps it for input deletions outside retention policies. For Spark transforms, this requires `v2_semantics=True`.
If your writes must be pure appends, `strict_append=True` uses an APPEND transaction for incremental writes. Palantir's documentation warns: "Trying to overwrite an existing file will lead to an exception." If the inputs are not incremental, it runs as a snapshot, so the docs say to pair it with `require_incremental=True`.
Schema rules when you read your own output
Palantir notes: "Although default read mode is current, in most cases you should use previous." The transform must be running incrementally, with `ctx.is_incremental` set to True, to see previous output. Passing a schema comes with strict rules:
- On an incremental run, the schema is compared against the last output. Mismatched column types, nullability or column order raise an exception.
- Pin column order with `out.write_dataframe(df.select(schema.fieldNames()))`.
- Foundry saves every column as nullable. Reading your output in previous mode with a supplied schema that has non-nullable fields fails with a `SchemaMismatchError`.
- On a non-incremental run, the schema is required when reading with `previous`.
Changing logic mid-stream
The documented way to force a rebuild after a logic change is `semantic_version`. Palantir's documentation says: "If the semantic version of the current run is different than the semantic version of the previous run, the transform will run non-incrementally."
The value defaults to 1. When you convert an existing transform, a missing previous version is treated as 1. The docs say: "This allows the transform to start running incrementally without requiring a new snapshot."
Bump the number, for example to 2, when you want one clean recompute. In our view, the version number is the right place to record a logic change that makes old output inconsistent with new output.
Test before you build
The docs say: "The Code Repositories preview feature always runs transforms in non-incremental mode, even when you pass require_incremental=True into the incremental() decorator." They add: "Incremental transforms behave the same way in VS Code preview as they would during a build." Palantir recommends VS Code preview for experimenting with the API.
Find out why a run was not incremental
When a build snapshots unexpectedly, Palantir says to look in the driver logs for the warning `transforms.api._incremental: Not running incrementally`.
What forces a full recompute
According to the documentation, a transform runs non-incrementally after:
- a `semantic_version` bump
- a SNAPSHOT transaction, an UPDATE that modifies existing files, or a disallowed DELETE on a non-snapshot input
- an output being built for the first time
- multi-output outputs being last built by different transforms
Watch out for
- Silent snapshots. Without `require_incremental=True`, a failed check produces an ordinary-looking full run.
- Empty previous output. On a snapshot run, `previous` returns no rows. Code that depends on it must handle that.
- Non-nullable schemas in previous mode. A supplied schema with non-nullable fields fails when you read your output in previous mode.
- Rewritten join tables. Mark them as snapshot inputs.
- Progressive slowness. Palantir says incremental reads load all past transactions since the last SNAPSHOT. If runs slow down over time, it recommends a SNAPSHOT build on the incremental inputs.
What to watch
We think `require_incremental=True` with `v2_semantics=True` is a sensible starting point for high-volume transforms, because a lost incremental run then surfaces as a failure rather than a quiet full rebuild. For compute beyond rate-limited traffic, Palantir directs users to the Overview and Analysis pages in Resource Management, according to the earlier Foundry News report.
