MCPcopy Index your code
hub / github.com/feast-dev/feast / do_put

Method do_put

sdk/python/feast/offline_server.py:132–148  ·  view source on GitHub ↗
(
        self,
        context: fl.ServerCallContext,
        descriptor: fl.FlightDescriptor,
        reader: fl.MetadataRecordBatchReader,
        writer: fl.FlightMetadataWriter,
    )

Source from the content-addressed store, hash-verified

130 @inject_user_details_decorator
131 @arrow_server_error_handling_decorator
132 def do_put(
133 self,
134 context: fl.ServerCallContext,
135 descriptor: fl.FlightDescriptor,
136 reader: fl.MetadataRecordBatchReader,
137 writer: fl.FlightMetadataWriter,
138 ):
139 key = OfflineServer.descriptor_to_key(descriptor)
140 command = json.loads(key[1])
141 if "api" in command:
142 data = reader.read_all()
143 logger.debug(f"do_put: command is{command}, data is {data}")
144 self.flights[key] = data
145
146 self._call_api(command["api"], command, key)
147 else:
148 logger.warning(f"No 'api' field in command: {command}")
149
150 def _call_api(self, api: str, command: dict, key: str):
151 assert api is not None, "api can not be empty"

Callers

nothing calls this directly

Calls 2

_call_apiMethod · 0.95
descriptor_to_keyMethod · 0.80

Tested by

no test coverage detected