(self, api: str, command: dict, key: str)
| 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" |
| 152 | |
| 153 | remove_data = False |
| 154 | try: |
| 155 | if api == OfflineServer.offline_write_batch.__name__: |
| 156 | self.offline_write_batch(command, key) |
| 157 | remove_data = True |
| 158 | elif api == OfflineServer.write_logged_features.__name__: |
| 159 | self.write_logged_features(command, key) |
| 160 | remove_data = True |
| 161 | elif api == OfflineServer.persist.__name__: |
| 162 | self.persist(command, key) |
| 163 | remove_data = True |
| 164 | elif api == OfflineServer.validate_data_source.__name__: |
| 165 | self.validate_data_source(command) |
| 166 | remove_data = True |
| 167 | except Exception as e: |
| 168 | remove_data = True |
| 169 | logger.exception(e) |
| 170 | traceback.print_exc() |
| 171 | raise e |
| 172 | finally: |
| 173 | if remove_data: |
| 174 | # Get service is consumed, so we clear the corresponding flight and data |
| 175 | del self.flights[key] |
| 176 | |
| 177 | def get_feature_view_by_name( |
| 178 | self, fv_name: str, name_alias: str, project: str |
no test coverage detected