Skip to content

Configure results access

Configure how PyRel returns query results to Python. This guide explains the Materialize results step in the PyRel execution workflow and shows how to choose the download URL type for returned results.

  • 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.
  • You already have a valid PyRel connection configured. The examples on this page assume PyRel can load that connection.

This guide applies to the Materialize results step in the PyRel workflow:

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

When you materialize results back to Python, PyRel temporarily stores them in a Snowflake stage. PyRel then returns a URL that your client can use to download those staged results.

The machine that fetches the data must be able to reach the URL PyRel returns. If you want to export results to Snowflake tables instead of returning them to Python, see Query a model.

The data.download_url_type setting can be set to one of two values:

  • Use internal when the machine downloading the results can reach Snowflake-internal URLs.
  • Use external when the downloader needs a URL it can reach outside that network path.

To set the URL type:

  1. Set data.download_url_type in raiconfig.yaml:

    connections:
    # ...
    data:
    download_url_type: external
  2. Check the configured value:

    from relationalai.semantics import Model
    m = Model("MyModel")
    print(m.config.data.download_url_type) # should print "external"