Skip to main content
Version: 1.2.0

Artifacts API

User has a possibility to associate with each feature set an artifact. Artifact can be either a file or a URL link.

Listing existing feature set artifacts

The list() returns currently available artifacts.

artifacts = feature_set.artifacts.list()
artifact = next(artifacts)

Artifact metadata

Each artifact contains some metadata that are accessible to the user

Field NameMeaning
idinternal id used by feature store
titletitle given when creating an artefact (automatically generated if not provided)
descriptiondescription given when creating an artefact (automatically generated if not provided)
artifact_typespecifies whether is artifact is a Link or File type
filenamename of the provided file (only available for file artifacts)
upload_statusstatus of the upload operation (only available for file artifacts)
urlurl provided when link artifact was created (only available for link artifacts)

Retrieving file artifact

To download a file artifact use retrieve(path, overwrite_existing_file) method. The path argument has to point to a valid directory and can contain file name. If the file name is not part of the path, then file name of the originally uploaded file is used instead. The overwrite_existing_file argument specifies whether an already existing file can be overwritten. By default, overwriting is not enabled and if a file already exists then the method ends with an exception.

# assuming /home/alice/feature_set_artifacts folder exists
# save with original file name
artifact.retrive("/home/alice/feature_set_artifacts/")

# save with new file name
artifact.retrive("/home/alice/feature_set_artifacts/samples.txt")

# save with new file name, overwrite exisitng file
artifact.retrive("/home/alice/feature_set_artifacts/samples.txt", overwrite_existing_file="y")

Saving file artifact

To upload a file artifact use store_file(path, title, description) method. The path argument has to point to a valid file which is going to be uploaded. If the title or description argument is not provided, then it will be automatically generated.

file_artifact = feature_set.artifacts.store_file(file_path="/home/bob/feature_set_artifacts/to_upload.txt", title="Remarks")

To upload a file artifact use store_file(path, title, description) method. The path argument has to point to a valid file which is going to be uploaded. If the title or description argument is not provided, then it will be automatically generated.

link_artifact = feature_set.artifacts.store_link(url="/home/bob/feature_set_artifacts/to_upload.txt", title="Remarks")

Deleting artefact

To save feature store resources, when an artifact is no more needed it can be removed by calling a delete() method on an artifact object.

artifact.delete()

Feedback