Skip to content

Configure results access

You can configure whether or not PyRel query results can be accessed from outside your Snowflake account’s internal network by setting the data.download_url_type field in your configuration. This guide explains how results access works, when you might need to change the URL type, and how to set that preference in raiconfig.yaml or Python code.

  • 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 a query result, the results are temporarily stored in a Snowflake stage and must be downloaded from there to your Python client. PyRel returns a URL that your client can use to download the results from that stage.

For the download to succeed, the machine that fetches the results must be able to reach the URL PyRel returns. You can configure the URL type PyRel returns for query result downloads to allow external access when needed, or ensure that only internal URLs are returned when the client is running on your Snowflake account’s internal network.

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"