Python client migration guide
This guide compares the H2O MLOps Python client across versions. Each table shows how to perform an operation in the earlier version (left column) and in the later version (right column). Use these comparisons to update your code.
From v1.3.x to v1.4.x
Imports
v1.3.x | v1.4.x |
---|---|
|
|
Client creation
From v1.4.x onwards, support for creating the client using gateway_url
and token_provider
has been removed. Instead, you must use refresh_token
and h2o_cloud_url
.
v1.3.x | v1.4.x |
---|---|
|
|
Get allowed affinities and tolerations
v1.3.x | v1.4.x |
---|---|
|
|
|
|
Get the current user
v1.3.x | v1.4.x |
---|---|
|
|
Returns the user's information as a Python dictionary. | Returns the user's information as an |
Access project-related services
In version 1.4.x, the concept of projects has been replaced by workspaces. Update your code by replacing references to projects
with workspaces
.
v1.3.x | v1.4.x |
---|---|
|
|
Create and register an experiment into a model
The previous method of creating experiments and registering them with models is still supported.
v1.3.x | v1.4.x |
---|---|
|
Users can pass an instance of the |
- When you link an experiment to a workspace from H2O Driverless AI, a new model version is automatically registered under the model that matches the experiment’s name.
- If no matching model exists, a new model is created with the experiment name, and the experiment is registered as its first version.
- Therefore, you don’t need to manually register experiments in MLOps. You can use the model directly.
Update an artifact’s parent
v1.3.x | v1.4.x |
---|---|
|
|
Get artifact's model-specific metadata (if applicable)
v1.3.x | v1.4.x |
---|---|
|
|
Convert JSON artifact to a dictionary
v1.3.x | v1.4.x |
---|---|
|
|
Get the experiment associated with a model version
v1.3.x | v1.4.x |
---|---|
|
|
List scoring runtimes
The experiment.scoring_artifact_types
property was removed in 1.4.x.
v1.3.x | v1.4.x |
---|---|
|
|
|
|
When creating a deployment, instead of passing scoring_runtimes[correct_index]
, you can use mlops.runtimes.scoring.get(artifact_type=..., runtime_uid=...)
to get the scoring_runtime
, if you already know the corresponding artifact_type
and runtime_uid
.
Create a deployment
v1.3.x | v1.4.x |
---|---|
|
|
Starting in v1.4.x, when you create a deployment with hash-based security options, provide the passphrase directly. In earlier versions, you had to provide the hashed value instead.
Create a deployment with new model monitoring options
v1.3.x | v1.4.x |
---|---|
|
|
This is equivalent to how users created deployments with the old monitoring in the previous client. After the old monitoring was removed, this change was introduced. Note that the parameters accepted by options.MonitoringOptions
differ from those used in the old monitoring.
Wait for deployment to become healthy
The previous method is still supported.
v1.3.x | v1.4.x |
---|---|
|
|
Get deployment state
v1.3.x | v1.4.x |
---|---|
|
|
|
|
Update a deployment
v1.3.x | v1.4.x |
---|---|
|
|
| |
| |
|
In v1.4.x, you can update multiple settings at once.
Access deployment scorer
v1.3.x | v1.4.x |
---|---|
You do not need to fetch the scorer. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Score against a deployment
The previous method is still supported if the correct scoring endpoint URL is provided.
v1.3.x | v1.4.x |
---|---|
|
|
Kubernetes options for a batch scoring job
v1.3.x | v1.4.x |
---|---|
|
|
|
|
Get entity creator (if applicable)
v1.3.x | v1.4.x |
---|---|
|
|
View the complete Table
v1.3.x | v1.4.x |
---|---|
|
|
In version 1.4.x, a Table
instance renders a nicely formatted view but displays only up to 50 rows by default.
From v1.2.x to v1.3.x
Removal of environments
v1.2.x | v1.3.x |
---|---|
| You do not need to fetch the environment. |
|
|
|
|
|
|
|
|
From v1.1.x to v1.2.x
There are no breaking changes.
From v1.0.x to v1.1.x
Minimal supported version
v1.0.x | v1.1.x |
---|---|
|
|
Create a deployment
v1.0.x | v1.1.x |
---|---|
|
|
- The
security_options
field is no longer optional. - To create a deployment with the
No Security
option:- For MLOps version 0.68.0 or later, set:
security_options = options.SecurityOptions(disabled_security=True)
- For MLOps versions earlier than 0.68.0, set:
security_options = options.SecurityOptions()
- For MLOps version 0.68.0 or later, set:
- Submit and view feedback for this page
- Send feedback about H2O MLOps to cloud-feedback@h2o.ai