Skip to main content
Version: 1.0

login

Summary​

note

To use tecton.login(interactive=True) in a Databricks notebook, the notebook cluster must running on Databricks Runtime 11.3 or higher.

note

It is currently not possible to query the online store using user credentials. To use get_online_features, a Service Account API key must be set using tecton.login(tecton_url="https://<example>.tecton.ai", tecton_api_key="<api_key>").

Authenticate to a Tecton instance either as a user or with a Tecton API key.
 
These credentials last for the duration of the interactive Python session. A Service Account API key can also be set in the session using set_credentials (deprecated), but if user credentials are set, they will take priority over Service Account credentials.
 
If logging in as a user, the method will prompt you to open a link in your browser. Sign in to Tecton and it will display an authorization code to copy and paste into standard input back in your notebook.
 
If your interactive environment does not support standard input (for example EMR notebooks do not), you can set interactive=False and use the 2-step login flow. First, run:
tecton.login(tecton_url="https://<example>.tecton.ai", interactive=False)
Then follow the URL to get your authorization code, and finally, run:
tecton.complete_login("<authorization_code>")

Example usages:

To authenticate interactively as a user:
tecton.login(tecton_url="https://<example>.tecton.ai")
To authenticate non-interactively as a user
tecton.login(tecton_url="https://<example>.tecton.ai", interactive=False)
To authenticate with a Tecton API key
tecton.login(tecton_url="https://<example>.tecton.ai", tecton_api_key="<api_key>")

Parameters

  • tecton_url (str) - HTTP URL of the Tecton instance, e.g. https://<example>.tecton.ai

  • interactive (bool) - Only for user login. When set to True, you will be prompted to pass the authorization code via standard input to complete login. This relies on your interactive environment supporting Python's builtin input() function. If your environment does not support this, you can call login() with interactive=False to bypass the standard input prompt, and then pass the authorization code to tecton.complete_login("<authorization_code>") to complete login. Default: true

  • tecton_api_key (Optional[str]) - Optional Tecton API key. Set to authenticate as a Service Account. Default: None

Returns

None

Was this page helpful?