MCPcopy
hub / github.com/feast-dev/feast / Infra

Class Infra

sdk/python/feast/infra/infra_object.py:114–149  ·  view source on GitHub ↗

Represents the set of infrastructure managed by Feast. Args: infra_objects: A list of InfraObjects, each representing one infrastructure object.

Source from the content-addressed store, hash-verified

112
113@dataclass
114class Infra:
115 """
116 Represents the set of infrastructure managed by Feast.
117
118 Args:
119 infra_objects: A list of InfraObjects, each representing one infrastructure object.
120 """
121
122 infra_objects: List[InfraObject] = field(default_factory=list)
123
124 def to_proto(self) -> InfraProto:
125 """
126 Converts Infra to its protobuf representation.
127
128 Returns:
129 An InfraProto protobuf.
130 """
131 infra_proto = InfraProto()
132 for infra_object in self.infra_objects:
133 infra_object_proto = infra_object.to_infra_object_proto()
134 infra_proto.infra_objects.append(infra_object_proto)
135
136 return infra_proto
137
138 @classmethod
139 def from_proto(cls, infra_proto: InfraProto):
140 """
141 Returns an Infra object created from a protobuf representation.
142 """
143 infra = cls()
144 infra.infra_objects += [
145 InfraObject.from_infra_object_proto(infra_object_proto)
146 for infra_object_proto in infra_proto.infra_objects
147 ]
148
149 return infra
150
151
152def _get_infra_object_class_from_type(infra_object_class_type: str):

Callers 4

plan_infraMethod · 0.90
plan_infraMethod · 0.90
_get_infraMethod · 0.90
test_update_infraFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_update_infraFunction · 0.72