(
self,
context: fl.ServerCallContext,
descriptor: fl.FlightDescriptor,
reader: fl.MetadataRecordBatchReader,
writer: fl.FlightMetadataWriter,
)
| 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" |
nothing calls this directly
no test coverage detected