dlt.common.configuration.specs.gcp_credentials
GcpCredentials Objects
@configspec
class GcpCredentials(CredentialsConfiguration, WithObjectStoreRsCredentials)
to_native_credentials
def to_native_credentials() -> Any
Returns respective native credentials for service account or oauth2 that can be passed to google clients
to_gcs_credentials
def to_gcs_credentials() -> Dict[str, Any]
Dict of keyword arguments that can be passed to gcsfs. Delegates default GCS credential handling to gcsfs.
to_object_store_rs_credentials
def to_object_store_rs_credentials() -> Dict[str, str]
Dict of keyword arguments that can be passed to object_store Rust crate.
Delegates default GCS credential handling to object_store Rust crate.
to_gcs_bearer_token
def to_gcs_bearer_token(cached: bool = True) -> Tuple[str, Optional[datetime]]
Returns an OAuth2 access token for GCS and its expiry.
Arguments:
cachedbool - IfTrue, returns the cached token while it is valid, ifFalse, always gets a new token and caches it.
Returns:
Tuple[str, Optional[datetime]]: The token and its UTC expiry, None when unknown.
GcpServiceAccountCredentialsWithoutDefaults Objects
@configspec
class GcpServiceAccountCredentialsWithoutDefaults(GcpCredentials,
WithPyicebergConfig)
parse_native_representation
def parse_native_representation(native_value: Any) -> None
Accepts ServiceAccountCredentials as native value. In other case reverts to serialized services.json
to_native_credentials
def to_native_credentials() -> Any
Returns google.oauth2.service_account.Credentials
GcpOAuthCredentialsWithoutDefaults Objects
@configspec
class GcpOAuthCredentialsWithoutDefaults(GcpCredentials, OAuth2Credentials,
WithPyicebergConfig)
parse_native_representation
def parse_native_representation(native_value: Any) -> None
Accepts Google OAuth2 credentials as native value. In other case reverts to serialized oauth client secret json
on_partial
def on_partial() -> None
Allows for an empty refresh token if the session is interactive or tty is attached
to_native_credentials
def to_native_credentials() -> Any
Returns google.oauth2.credentials.Credentials
GcpDefaultCredentials Objects
@configspec
class GcpDefaultCredentials(CredentialsWithDefault, GcpCredentials)
parse_native_representation
def parse_native_representation(native_value: Any) -> None
Accepts google credentials as native value
on_partial
def on_partial() -> None
Looks for default google credentials and resolves configuration if found. Otherwise continues as partial