Are you using PyRel v1 with a raiconfig.yaml file and received an error like the below when you try to connect?
Validation errors:
Value error, Config must have at least one connection (type: value_error)
While this error message is indicating there is a problem with the Snowflake connection, it might actually indicate there is a syntax issue or other problem, which is preventing the connection section from being properly read. In any case, first double check that your connection is properly configured.
Connection Configuration
In a raiconfig.yaml file it should look something like this, if using a user password authentication:
default_connection: sf
connections:
sf:
type: snowflake
authenticator: username_password
account: my_account
warehouse: my_warehouse
user: my_user
password: "{{ env_var('SNOWFLAKE_PASSWORD') }}"
In a config object that is loaded programmatically in your code, the same config would look like:
import os
from relationalai.config import create_config
cfg = create_config(
default_connection="sf",
connections={
"sf": {
"type": "snowflake",
"authenticator": "username_password",
"account": "my_account",
"warehouse": "my_warehouse",
"user": "my_user",
"password": os.environ["SNOWFLAKE_PASSWORD"],
},
},
)
Please take note of the structure inherent in both of these examples. You indicate your default connection is named sf. Next under the connections section of the config you define that connection named sf by setting its parameters. If you are using a different type of authenticator other than username_password then your parameters may be different.
Other Causes
If the connection section of your config looks good, then it's time to look for other problems.
Whitespace
Both a .yaml file and the config object expect a specific structure. Double check your indentation is correct. Also be sure not to mix tabs and spaces.
Programmatic Config: Dict Format
In the config object in python, double check that everything is in dictionary format. This means each section is wrapped in curly braces { ... } and also that keys and values are in double quotes ". The exceptions to this are numerical values like an authenticator passcode, or functions like the os.environ[] from the example above.
Dependency or Version Problems
Anything that prevents PyRel from running properly can also prevent the config from being read properly. If you're working with a virtual environment, be sure it is activated. For example with venv:
source .venv/bin/activateIf you've been trying out different versions upgrading and downgrading the relationalai package or its dependencies, be sure they are installed at the desired version. To install/upgrade with pip:
python -m pip install --upgrade relationalaiTo double check your relationalai package version, import it and print it out. In a python session:
import relationalai
print(relationalai.__version__)
If you're still having problems getting connected, reach out to RelationalAI Support at: support@relational.ai.