|
28 | 28 |
|
29 | 29 | from aiohttp import web |
30 | 30 | import marshmallow |
31 | | -from webargs import fields |
32 | 31 |
|
33 | 32 | from oslo_config import cfg |
34 | 33 | from oslo_log import log |
@@ -324,57 +323,27 @@ def get_train_args(self): |
324 | 323 |
|
325 | 324 | :param parser: an argparse like object |
326 | 325 |
|
327 | | - This method will call the wrapped model ``add_train_args``. If the |
328 | | - underlying methid implements the DEPRECATED way of passing arguments |
329 | | - we will try to load them from there. |
| 326 | + This method will call the wrapped model ``add_train_args``. |
330 | 327 | """ |
331 | 328 | try: |
332 | 329 | args = self.model_obj.get_train_args() |
333 | | - args = self._convert_old_args(args) |
334 | | - return args |
335 | 330 | except (NotImplementedError, AttributeError): |
336 | | - return {} |
| 331 | + args = {} |
| 332 | + return args |
337 | 333 |
|
338 | 334 | def get_predict_args(self): |
339 | 335 | """Add predict arguments into the predict parser. |
340 | 336 |
|
341 | 337 | :param parser: an argparse like object |
342 | 338 |
|
343 | | - This method will call the wrapped model ``get_predict_args``. If the |
344 | | - method does not exist, but the wrapped model implements the DEPRECATED |
345 | | - ``get_test_args`` we will try to load the arguments from there. |
| 339 | + This method will call the wrapped model ``get_predict_args``. |
346 | 340 | """ |
347 | 341 | try: |
348 | 342 | args = self.model_obj.get_predict_args() |
349 | 343 | except (NotImplementedError, AttributeError): |
350 | | - try: |
351 | | - args = self.model_obj.get_test_args() |
352 | | - args = self._convert_old_args(args) |
353 | | - except (NotImplementedError, AttributeError): |
354 | | - args = {} |
| 344 | + args = {} |
355 | 345 | return args |
356 | 346 |
|
357 | | - def _convert_old_args(self, args): |
358 | | - aux = {} |
359 | | - for k, v in args.items(): |
360 | | - if isinstance(v, dict): |
361 | | - LOG.warning("Loading arguments using the old and DEPRECATED " |
362 | | - "return value (i.e. an plain Python dictionary. " |
363 | | - "You should move to the new return value (i.e. a " |
364 | | - "webargs.fields dictionary as soon as possible. " |
365 | | - "All the loaded arguments will be converted to " |
366 | | - "strings. This is only supported for backwards " |
367 | | - "compatibility and may lead to unexpected errors. " |
368 | | - "Argument raising this warningr: '%s'", k) |
369 | | - |
370 | | - v = fields.Str( |
371 | | - missing=v.get("default"), |
372 | | - description=v.get("help"), |
373 | | - required=v.get("required"), |
374 | | - ) |
375 | | - aux[k] = v |
376 | | - return aux |
377 | | - |
378 | 347 |
|
379 | 348 | class NonDaemonProcess(multiprocessing.context.SpawnProcess): |
380 | 349 | """Processes must use 'spawn' instead of 'fork' (which is the default |
|
0 commit comments