-
Couldn't load subscription status.
- Fork 354
Labels
good first issueGood for newcomersGood for newcomers
Description
Background
When a dlt pipeline runs inside Snowpark Container Services, Snowflake mounts an OAuth access token at /snowflake/session/token and exposes SNOWFLAKE_HOST / SNOWFLAKE_ACCOUNT env vars. A standard connector call then looks like:
def get_login_token():
with open('/snowflake/session/token', 'r') as f:
return f.read()
conn = snowflake.connector.connect(
host = os.getenv('SNOWFLAKE_HOST'),
account = os.getenv('SNOWFLAKE_ACCOUNT'),
token = get_login_token(),
authenticator = 'oauth'
)Task
Extend dlt’s Snowflake destination to auto-detect and use that token so no extra credentials are required in-container.
Implementation
- Update
SnowflakeCredentials.on_resolvedso if/snowflake/session/tokenexists and not explicitly passed viatokenparam, we use it along with env'sSNOWFLAKE_HOSTandSNOWFLAKE_ACCOUNT - Do not require username argument
- Update to_connector_params to use token, host and account
- Include tests
- Update docs with an example
ajholguin
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers
Type
Projects
Status
Todo