Starting the client
- Python
- Scala
Once your Python environment is ready, run:
from featurestore import Client
client = Client(url, secure=False, root_certificates=None, config=config)
or
from featurestore import Client
with Client(url, secure=False, root_certificates=None, config=config) as client:
...
where:
url
- the endpoint address of the Feature Store Server as a string (usually inip:port
format).secure
- turn on secure connection for Feature Store API. If you run Feature Store behind nginx-ingress (which requires tls connection) make sure thesecure
flag is set toTrue
. Client may also require root certificates.root_certificates
- root certificates file location as a string or None to retrieve them from a default location chosen by gRPC runtime.config
- Additional client configuration. If not specified, defaults are used.
The following API can be used to enable or disable interactive logging. Logging is enabled by default.
client.show_progress(False)
It's good practice to close the connection after all action has
proceeded. You should call client.close()
or use the context manager.
Once your Scala is ready, run:
import ai.h2o.featurestore.Client
val client = Client(url)
or
import ai.h2o.featurestore.Client
val client = Client(url, secure=true)
or
import ai.h2o.featurestore.Client
val client = Client(url, secure=true, rootCertificates=path, config=config)
or
import scala.util.Using
import ai.h2o.featurestore.Client
Using.Manager { use =>
val client = use(Client(url, secure=true, rootCertificates=path, config=config))
...
}.get
where:
url
- the endpoint address of the Feature Store Server as a string (usually inip:port
format).secure
- turns on secure connection for Feature Store API. If you run Feature Store behind nginx-ingress (which requires tls connection) make sure thesecure
flag is set totrue
. Client may also require root certificates.rootCertificates
- root certificates file location as a string or null to retrieve them from a default location chosen by gRPC runtime.config
- Additional client configuration. If not specified, the defaults are used.
The following API can be used to enable or disable interactive logging. Logging is enabled by default.
client.show_progress(false)
It's good practice to close the connection after all action has
proceeded. You should call client.close()
or use the context manager.
Client configuration
We can pass a config
to the client constructor. The following examples
show how to create the configuration and explain what options can be
specified.
- Python
- Scala
config = ClientConfig(wait_for_backend=True, timeout=<value in seconds>, log_level=INFO)
wait_for_backend
- ifFalse
, client does not wait for the Feature Store Backend to be ready.timeout
- client-side timeout in seconds to terminate long waiting grpc calls.log_level
- Logging level to be used on the Python client. Supported values areCRITICAL
,ERROR
,WARNING
,INFO
andDEBUG
.
config = ClientConfig(waitForBackend=True, timeout=<value in seconds>)
waitForBackend
- iffalse
, client does not wait for the Feature Store Backend to be ready.timeout
- client-side timeout in seconds to terminate long waiting grpc calls.
The client configuration is stored by default in the user's home directory. You can change this location by setting the FEATURESTORE_USER_CONFIG
environmental variable to the desired location before starting the client.
Obtaining version
Both client and server version is printed out after client is created to standard output.
Versions can also be obtained by calling the following method:
- Python
- Scala
client.get_version()
client.getVersion()
Open Web UI
This method opens the Feature Store Web UI.
- Python
- Scala
client.open_website()
client.openWebsite()
- Submit and view feedback for this page
- Send feedback about H2O Feature Store to cloud-feedback@h2o.ai