Example #1
0
 def runner_from_sqa(self, runner_sqa: SQARunner) -> Runner:
     """Convert SQLAlchemy Runner to Ax Runner."""
     runner_class = REVERSE_RUNNER_REGISTRY.get(runner_sqa.runner_type)
     if runner_class is None:
         raise SQADecodeError(
             f"Cannot decode SQARunner because {runner_sqa.runner_type} "
             f"is an invalid type.")
     args = runner_class.deserialize_init_args(
         args=runner_sqa.properties or {})
     # pyre-fixme[45]: Cannot instantiate abstract class `Runner`.
     return runner_class(**args)
Example #2
0
 def runner_from_sqa(self, runner_sqa: SQARunner) -> Runner:
     """Convert SQLAlchemy Runner to Ax Runner."""
     runner_class = REVERSE_RUNNER_REGISTRY.get(runner_sqa.runner_type)
     if runner_class is None:
         raise SQADecodeError(
             f"Cannot decode SQARunner because {runner_sqa.runner_type} "
             f"is an invalid type.")
     args = self.get_init_args_from_properties(
         # pyre-fixme[6]: Expected `SQABase` for ...es` but got `SQARunner`.
         object_sqa=runner_sqa,
         class_=runner_class,
     )
     return runner_class(**args)