sfu module

Snowflake URI utility class that supports extraction of Snowflake configuration data and method parameters from Snowflake resource URIs.

class sfu.sfu.sfu(uri: str)

Bases: object

credentials(safe: bool = True) dict

Extract configuration data (only credentials) from a URI

Parameters

safe – If true, only return standard properties that can be passed to snowflake. If false, returns custom values as well.

Returns

A dictionary with the following keys (if available): user, password, account

configuration(safe: bool = True) dict

Extract configuration data (both credentials and non-credentials) from a URI

Parameters

safe – If true, only return standard properties that can be passed to snowflake. If false, returns custom values as well.

Returns

A dictionary with the following keys (if available): user, password, account, database, warehouse, schema, role

for_connection(safe: bool = True) dict

Extract all parameters for a connection constructor

Parameters

safe – If true, only return standard properties that can be passed to snowflake. If false, returns custom values as well.

Returns

A dictionary with the following keys (if available): user, password, account, database, warehouse, schema, role

for_db() [str, None]

Extract database name for a connection.cursor USE DATABASE <DB> command

Returns

Database name

for_warehouse() [str, None]

Extract warehouse name for a connection.cursor USE WAREHOUSE <WH> command

Returns

Warehouse name

for_table() [str, None]

Extract table name for a connection.cursor SELECT <COLS> FROM <TABLE> command

Returns

Table name

to_string() str

Constructs a uri based off of current value of the properties of this object