Represents the set of infrastructure managed by Feast. Args: infra_objects: A list of InfraObjects, each representing one infrastructure object.
| 112 | |
| 113 | @dataclass |
| 114 | class 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 | |
| 152 | def _get_infra_object_class_from_type(infra_object_class_type: str): |
no outgoing calls