mlflow_provider.hooks.client

Module Contents

Classes

MLflowClientHook

Hook that interacts with an HTTP endpoint with Python requests library.

class mlflow_provider.hooks.client.MLflowClientHook(method='POST', mlflow_conn_id=default_conn_name, auth_type=HTTPBasicAuth)

Bases: airflow.hooks.base.BaseHook

Hook that interacts with an HTTP endpoint with Python requests library. This hook is used to interact with the MLflow REST API. https://www.mlflow.org/docs/latest/rest-api.html

Parameters:
  • method (str) – the API method to be called

  • mlflow_conn_id (str) – connection that has the base API url i.e https://www.google.com/ and optional authentication credentials.

  • auth_type (AuthBase of python requests lib) – The auth type for the service

conn_name_attr = 'mlflow_conn_id'
default_conn_name = 'mlflow_default'
conn_type = 'http'
hook_name = 'MLflow Client'
get_conn(headers=None)

Returns http session to use with requests.

Parameters:

headers (dict) – additional headers to be passed through as a dictionary

run(endpoint=None, headers=None, request_params=None, **request_kwargs)

Executes the request

Parameters:
  • endpoint (str) – the endpoint to be called i.e. resource/v1/query?

  • headers (dict) – additional headers to be passed through as a dictionary

  • request_params (dict) – request params,