Suppress Recreates
The --suppress-recreates option for tecton apply enables users to override
Tecton's default Object recreate behavior for certain kinds of modifications.
This explains the recreate process, and when it may be appropriate to use the
--suppress-recreates option.
Use the --suppress-recreates flag with caution. Only use the flag when you are
confident that changes to a Tecton repo will not affect feature values in a way
that will disrupt your downstream consumers. Using the flag incorrectly can lead
to degraded model performance if the feature logic used for inference doesn't
match historical training data.
Only workspace owners are authorized to apply plans computed with
--suppress-recreates.
Recreating Objects in Tectonโ
During tecton apply, Tecton attempts to identify modification to business
logic that could invalidate features for downstream consumers in order to
prevent potentially breaking changes to production systems. These modifications
are highlighted as "recreating" the Tecton object in the plan output.
Recreating a Feature View with materialization enabled deletes any materialized data, and re-runs the backfill process from the feature start time. This process, called re-materialization, incurs cost and downtime.
Sometimes your judgement allows you to know that the desired modification will
not impact any downstream consumers, even though Tecton detects the state
change as a recreate. In these scenarios you can use the --suppress-recreates
option during tecton plan or tecton apply to force Tecton to treat the
modification as a simple update.
Supported use-cases for --suppress-recreatesโ
Conceptually, --suppress-recreates can be used in scenarios where the upstream
and downstream contracts of a feature pipeline are unchanged. For example,
--suppress-recreates can be used when the transformation logic is modified, so
long as the same schema is output.
The primary applications for --suppress-recreates are:
Unsupported use-casesโ
In some scenarios, Tecton will not allow the apply to precede with
--suppress-recreates. The best way to test if your scenario is valid is to run
tecton plan --suppress-recreates with the desired modification.
Recreates cannot be suppressed if any of the following occurs, and will result in a plan failure:
- Modification of the schema (such as adding a column or removing a column) of a Data Source or Feature View.
- Modification of the schema of the
RequestSourceobject that is used in an Realtime Feature View. - Some modifications of a Spark Stream Feature View with window aggregates, where the modification would invalidate the checkpoint.
- Increasing the ttl duration for a Feature View
Refactoring Python functionsโ
If you are updating a Python function in a way that does not impact feature
values, such as a refactor that adds comments or whitespace, you can use the
--suppress-recreates flag with tecton apply and tecton plan to suppress
rematerialization. The Python functions that can be changed, prior to using
--suppress-recreates, are:
-
The function referenced in the
post_processorparameter of thebatch_configorstream_configobject (in 0.4compatthis is theraw_batch_translatororraw_stream_translator).Example plan output when refactoring a
batch_configobject'spost_processor:โโโโโโโโโโโโ Plan Start โโโโโโโโโโ
~ Update BatchDataSource
name: users_batch
owner: demo-user@tecton.ai
hive_ds_config.common_args.post_processor.body:
@@ -1,4 +1,5 @@
def post_processor(df):
+ # drop geo location columns
return df \
.drop('lat') \
.drop('long')
โโโโโโโโโโโโ Plan End โโโโโโโโโโโโ