polars.Config.set_default_credential_provider#
- classmethod Config.set_default_credential_provider(
- credential_provider: CredentialProviderFunction | Literal['auto'] | None,
Set a default credential provider.
Sets the default credential provider to be used for functions that read / write to cloud storage.
Warning
This functionality is considered unstable. It may be changed at any point without it being considered a breaking change.
- Parameters:
- credential_provider
Provide a function that can be called to provide cloud storage credentials. The function is expected to return a dictionary of credential keys along with an optional credential expiry time.
Can also be set to None, which globally disables auto-initialization of credential providers, or “auto” (the default behavior).
Examples
>>> pl.Config.set_default_credential_provider( ... pl.CredentialProviderAWS( ... assume_role={"RoleArn": "...", "RoleSessionName": "..."} ... ) ... ) <class 'polars.config.Config'>