blob: 4a97c0abfda8988a1f89c88f51546153eef83574 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
from marshmallow import fields, post_load
from azure.ai.ml._schema.core.fields import ArmStr
from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, AzureMLResourceType
from .artifact import ArtifactSchema
class IndexAssetSchema(ArtifactSchema):
name = fields.Str(required=True, allow_none=False)
id = ArmStr(azureml_type=AzureMLResourceType.INDEX, dump_only=True)
stage = fields.Str(default="Development")
path = fields.Str(
required=True,
metadata={
"description": "A local path or a Blob URI pointing to a file or directory where index files are located."
},
)
properties = fields.Dict(keys=fields.Str(), values=fields.Str())
@post_load
def make(self, data, **kwargs):
from azure.ai.ml.entities._assets import Index
return Index(base_path=self.context[BASE_PATH_CONTEXT_KEY], **data)
|