Configure compilation behavior
Use compilation settings to control dry-run behavior and type-error enforcement while developing a model. This guide explains what these settings change during deployment and how to configure them.
- Prerequisites
- You have access to a Snowflake account with the RelationalAI Native App installed. If you are unsure, contact your Snowflake administrator.
- You have a working PyRel installation. See Install and run PyRel for instructions.
What compilation configuration covers
Section titled “What compilation configuration covers”When you deploy a model, PyRel compiles its definitions into a plan for creating and refreshing the model’s outputs. Compilation can catch problems such as incompatible types before PyRel applies that plan.
Use this table to choose which setting to change:
| Setting | Use it when |
|---|---|
| Dry-run mode | You want to compile the model without applying the resulting plan or triggering its refreshes. The surrounding deployment workflow can still write metadata. |
| Soft type errors | You want compilation to continue after reporting type-inference errors while you investigate them. |
Enable or disable dry-run mode
Section titled “Enable or disable dry-run mode”Set compiler.dry_run to true to compile the model without executing the resulting plan or starting its refreshes.
The setting defaults to false.
Dry-run mode doesn’t show what a deployment would change in Snowflake. For that, review a deployment plan instead.
Select the tab for your preferred configuration method to see how to set it up.
-
Set
compiler.dry_runinraiconfig.yamlconnections:# ...compiler:dry_run: true -
Inspect the parsed config
from relationalai.semantics import Modelm = Model("MyModel")print(m.config.compiler.dry_run)A printed value of
Trueconfirms that PyRel loaded thedry_runsetting from your config.
Set compiler.dry_run with CompilerConfig or a plain Python dict.
These examples assume file discovery already provides a valid connection configuration.
Use one of the following approaches:
-
Set the value with a typed config class
from relationalai.config import CompilerConfig, create_configfrom relationalai.semantics import Modelcfg = create_config(compiler=CompilerConfig(dry_run=True))m = Model("MyModel", config=cfg)print(m.config.compiler.dry_run) -
Set the value with a dict
from relationalai.config import create_configfrom relationalai.semantics import Modelcfg = create_config(compiler={"dry_run": True})m = Model("MyModel", config=cfg)print(m.config.compiler.dry_run)
Each example should print True.
This confirms only that PyRel loaded the setting, not that the model compiles or that deployment is free of side effects.
If the value is different, check the active profile and configuration overrides in Load configuration from files.
Enable or disable soft type errors
Section titled “Enable or disable soft type errors”Set compiler.soft_type_errors to true to let compilation continue after reporting errors found during type inference.
The setting applies when PyRel compiles a model for deployment and defaults to false, so those errors normally stop compilation.
Select the tab for your preferred configuration method to see how to set it up.
-
Set
compiler.soft_type_errorsinraiconfig.yamlconnections:# ...compiler:soft_type_errors: true -
Inspect the parsed config
from relationalai.semantics import Modelm = Model("MyModel")print(m.config.compiler.soft_type_errors)A printed value of
Trueconfirms that PyRel loaded thesoft_type_errorssetting from your config.
Set compiler.soft_type_errors with CompilerConfig or a plain Python dict.
These examples assume file discovery already provides a valid connection configuration.
Use one of the following approaches:
-
Set the value with a typed config class
from relationalai.config import CompilerConfig, create_configfrom relationalai.semantics import Modelcfg = create_config(compiler=CompilerConfig(soft_type_errors=True))m = Model("MyModel", config=cfg)print(m.config.compiler.soft_type_errors) -
Set the value with a dict
from relationalai.config import create_configfrom relationalai.semantics import Modelcfg = create_config(compiler={"soft_type_errors": True})m = Model("MyModel", config=cfg)print(m.config.compiler.soft_type_errors)
Each example should print True.
This confirms only that PyRel loaded the setting.
If the value is different, check the active profile and configuration overrides in Load configuration from files.