Skip to content

Configure compilation behavior

Compilation settings control how PyRel validates your model and query before submitting a job to the RelationalAI Native App. This guide covers what compilation means in PyRel, the settings that affect it, and how to change those settings.

  • 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 Set Up Your Environment for instructions.

This guide applies to the Build model and query step in the PyRel execution workflow:

1. Load and validateconfiguration2. Build modeland query3. SubmitRelationalAI job4. Run job withreasoners5. Materializeresults

When you run PyRel, it first compiles the model and query you wrote in Python. This includes your model definitions, any materialization requirements, and the query you want to run. During this step, PyRel translates that code into a form the backend can execute and can catch validation problems early, including type errors.

Use this table to choose which setting to change:

SettingUse it when
Dry-run modeYou want to validate your model only without executing it.
Soft type errorsYou want type errors treated more leniently while you iterate.

Use dry-run mode when you want PyRel to only compile your model and/or query and not execute it. It is disabled by default.

Select the tab for your preferred configuration method to see how to set it up.

  1. Set compiler.dry_run in raiconfig.yaml

    connections:
    # ...
    compiler:
    dry_run: true
  2. Inspect the parsed config

    from relationalai.semantics import Model
    m = Model("MyModel")
    print(m.config.compiler.dry_run)

    A printed value of True confirms that PyRel loaded the dry_run setting from your config.

Use soft type errors when you want PyRel to treat type errors more leniently while you iterate. It is disabled by default, so compilation will fail on type errors unless you turn it on.

Select the tab for your preferred configuration method to see how to set it up.

  1. Set compiler.soft_type_errors in raiconfig.yaml

    connections:
    # ...
    compiler:
    soft_type_errors: true
  2. Inspect the parsed config

    from relationalai.semantics import Model
    m = Model("MyModel")
    print(m.config.compiler.soft_type_errors)

    A printed value of True confirms that PyRel loaded the soft_type_errors setting from your config.