Search code examples
pythonmlopsmlrunfeature-store

Access key must be provided in Client() arguments or in the V3IO_ACCESS_KEY environment variable


I got the error ValueError: Access key must be provided in Client() arguments or in the V3IO_ACCESS_KEY environment variable during data ingest in MLRun CE (version 1.5.0).

I used this code:

import mlrun
import mlrun.feature_store as fstore
import sys, time, pandas, numpy

def test():
    project_name = "my-project"
    feature_name = "fs-01"

    mlrun.set_env_from_file("mlrun-nonprod.env")
    project = mlrun.get_or_create_project(project_name, context='./', user_project=False)


    feature_set = fstore.FeatureSet(feature_name, entities=[fstore.Entity("fn0"),
                                                            fstore.Entity("fn1")],
                                    engine="storey")
    feature_set.set_targets(targets=[mlrun.datastore.ParquetTarget()], with_defaults=False)
    feature_set.save()

    dataFrm = pandas.DataFrame(numpy.random.randint(low=0, high=1000, size=(100, 10)),
                               columns=[f"fn{i}" for i in range(10)])    
    fstore.ingest(feature_set,dataFrm, overwrite=True)

if __name__ == '__main__':
    test()

Thanks for help.


Solution

  • I got it, you have to define path for ParquetTarget, because the Path has default value v3io:///projects/{project}/FeatureStore/{name}/parquet/ and it required V3IO_* parameters.

    Use the relevant value to the standard file system e.g.:

    • mlrun.datastore.ParquetTarget(path="./")
    • mlrun.datastore.ParquetTarget(path="c:\test\")

    I tested it and it works