def _get_table()

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


  def _get_table(self, schema, table_name, schema_name):
    table = next(
        (
            t[self.SOURCE_TYPE_TO_COLUMNS[self.source_type]]
            for t in schema
            if t["table"] == table_name
        ),
        None,
    )

    if not table:
      available_tables = self._list_tables(schema=schema)
      raise KeyError(
          f"Source table `{table_name}` does not appear in the"
          f" database `{schema_name}`. Available tables are:"
          f" {available_tables}"
      )
    return table