Asynchronous methods
- Python
Several methods in the Feature Store Client API have asynchronous
variants (methods ending with _async).
For example, starting an ingestion asynchronously:
job = feature_set.ingest_async(source)
This method returns a job immediately instead of blocking. The job exposes:
done— a property that isTrueonce the job has finished,Falseotherwise.get_result()— a method that returns the result of the job. If it is called before the job has finished, an exception is thrown.wait_for_result(poll_interval=2.0, timeout=None)— a method that blocks until the job completes and then returns its result. This is the most convenient way to wait for an asynchronous job.
if job.done:
result = job.get_result()
# Or simply block until the job finishes and return the result:
result = job.wait_for_result()
Asynchronous schema extraction
Schema extraction runs as a job, so it has asynchronous variants too. Call them on the workspace you intend to register the feature set in — see Schema extraction in the Workspaces API for why the scope matters.
- Python
workspace = client.workspaces.list(name="my_workspace")[0]
# Extract a schema from a data source
job = workspace.extract_schema_from_source_async(source)
schema = job.wait_for_result()
# Extract a derived schema from existing feature sets
job = workspace.extract_derived_schema_async(
feature_sets=[parent_feature_set],
transformation=transformation,
)
schema = job.wait_for_result()
Both methods return a Job immediately, and wait_for_result() returns the
extracted Schema.
note
The same methods also exist on the client
(client.extract_schema_from_source_async(...)), but they scope the job to your
default workspace. Prefer the workspace-scoped form.
Feedback
- Submit and view feedback for this page
- Send feedback about H2O Feature Store to cloud-feedback@h2o.ai