API Reference

exasol.mlflow_plugin.env_vars.ENV_BUCKETFS_USER = 'EXA_BUCKETFS_USER'

Name of the environment variable containing the user name for writing to the BucketFS of an Exasol On-premise instance.

exasol.mlflow_plugin.env_vars.ENV_BUCKETFS_PASSWORD = 'EXA_BUCKETFS_PASSWORD'

Name of the environment variable containing the password for writing to the BucketFS of an Exasol On-premise instance.

exasol.mlflow_plugin.env_vars.ENV_SSL_CERT_VALIDATION = 'EXA_SSL_CERT_VALIDATION'

Name of the environment variable specifying whether the validity of SSL certificates should be verified.

Supported values: yes, no, y, n, true, false (case-insensitive).

exasol.mlflow_plugin.artifacts.bucketfs_connector.udf_path(artifact_uri: str) str[source]

If artifact_uri points to the BucketFS, return the associated path mounted in local file system.

Raises a ParseError in case artifact_uri does not point to BucketFS.

exasol.mlflow_plugin.artifacts.bucketfs_connector.local_path_or_uri(artifact_uri: str) str[source]

If artifact_uri points to the BucketFS and the associated path is mounted in local file system, then return this path. Otherwise return the URI.

exasol.mlflow_plugin.artifacts.bucketfs_connector.load_model_with_fallback(artifact_uri: str, load_func: Callable[[...], Any], **kwargs) Any[source]

Assuming the artifact_uri points to the BucketFS: Try loading the artifact using the associated path mounted in local file system. On exception try loading the artifact via the URI (e.g. HTTP).

Loading the model from the local file system can fail due to multiple reasons, e.g. the UDF does not have read permission for the path or the model is damaged or cannot be loaded for other reasons.

Parameters:
  • artifact_uri

    The URI of the artifact, examples:

    • "exa+bfs://localhost:1234/bfsdefault/default"

    • "mlflow-artifacts:/2/models/m-0b55c1c46bcd47f9a633bc3fd1b59e4a/artifacts"

  • load_func – Function to actually load the model, e.g. mlflow.sklearn.load_model.

class exasol.mlflow_plugin.artifacts.bucketfs_connector.BfsSpecError[source]

Insufficient or invalid connection parameters for Exasol BucketFS.

Subclases: * ParseError: Required parameters cannot be parsed from the artifact_root * EnvError: A required environment variable is not set.

class exasol.mlflow_plugin.artifacts.bucketfs_connector.EnvError[source]

Required environment variable was not set.

class exasol.mlflow_plugin.artifacts.bucketfs_connector.ParseError[source]

Failed to parse a fully specified BucketFS location from an artifact_root string.

class exasol.mlflow_plugin.artifacts.bucketfs_connector.Connector(uri: str, username: str, password: str, ssl_cert_validation: bool, verify_bucket: bool = True)[source]

Provides parameters for accessing Exasol BucketFS via MLflow artifact store or directly.

property bucketfs_location: PathLike

The exasol.bucketfs.PathLike associated with the current Connector instance.

classmethod for_udfs(artifact_uri: str) Connector[source]

Construct a Connector instance for accessing the path mounted in local file system associated with the specified artifact_uri.

Environment variables are not required in this case.

classmethod from_env(artifact_uri: str) Connector[source]

Construct a Connector instance from the specified artifact_uri and the related environment variables.

Environment variables ENV_BUCKETFS_USER and ENV_SSL_CERT_VALIDATION are optional.

Raises an EnvError in case the required variable ENV_BUCKETFS_PASSWORD is not set or empty.