Skip to main content
Version: 0.6

tecton.set_validation_mode

tecton.set_validation_mode(...)

Summary​

Convenience utility to set the Tecton object validation mode for the lifetime of the Python process.

Must be either “explicit” (tecton.ValidationMode.EXPLICIT) or “auto” (tecton.ValidationMode.AUTOMATIC). “explicit” is the default.

In “auto” mode, locally defined Tecton objects will automatically trigger validation when needed.

Parameters​

  • mode

Examples​

import tecton

tecton.set_validation_mode("auto")

credit_scores_batch = tecton.BatchSource(
name="credit_scores_batch",
batch_config=tecton.HiveConfig(database="demo_fraud", table="credit_scores"),
)

df = credit_scores_batch.get_dataframe() # Will automatically trigger validation.

In “explicit” mode, locally defined Tecton objects must be validated before they can be used to execute many methods.

import tecton

tecton.set_validation_mode("auto")

credit_scores_batch = tecton.BatchSource(
name="credit_scores_batch",
batch_config=tecton.HiveConfig(database="demo_fraud", table="credit_scores"),
)

credit_scores_batch.validate()

df = credit_scores_batch.get_dataframe()
info

Tecton objects fetched from the Tecton backend have already been validated during tecton plan and do not need to be re-validated.

Was this page helpful?

Happy React is loading...