示例#1
0
def test_run_info_is_preserved_for_artifacts(repo):
    @p.provenance()
    def foo(a):
        return a + 10

    res = foo(5)
    expected_info = pc.run_info()
    assert res.artifact.run_info == expected_info

    reloaded = repo.get_by_id(res.artifact.id)
    reloaded.run_info == expected_info
示例#2
0
def artifact_record(**kargs):
    artifact_props = t.merge({k: None for k in  pc.artifact_properties},
                             _artifact_record_st.example(),
                             {'inputs': {'varargs':[1,2,3], 'kargs': {}},
                              'fn_module': 'foo', 'fn_name': 'bar',
                              'value': 55, 'name': 'bar',
                              'version': 0,
                              'serializer': 'joblib',
                              'run_info': pc.run_info()},
                             kargs)
    return pc.ArtifactRecord(**artifact_props)