def _load_discover_result()

in migration_toolkit/sql_generators/create_table/discover_result_parser.py [0:0]


  def _load_discover_result(self):
    logger.debug(f"Loading '{self.discover_result_path}'..")
    with open(self.discover_result_path, "r") as f:
      try:
        discover_result = json.load(f)
      except Exception as ex:
        raise TypeError(
            ex,
            f"Failed to load {self.discover_result_path} as a `.json` file."
            f" Make sure {self.discover_result_path} was generated using"
            " `discover.py` and try again.",
        )

    return discover_result[self.SOURCE_TYPE_TO_RDBMS[self.source_type]][
        self.SOURCE_TYPE_TO_SCHEMAS[self.source_type]
    ]