def _wait_for_operation_to_complete(self, project_id, operation_name):
service = self.get_conn()<EOL>while True:<EOL><INDENT>operation_response = service.operations().get(<EOL>project=project_id,<EOL>operation=operation_name,<EOL>).execute(num_retries=self.num_retries)<EOL>if operation_response.get("<STR_LIT:status>") == CloudSqlOperationStatus.DONE:<EOL><INDENT>error = operation_response.get("<STR_LIT:error>")<EOL>if error:<EOL><INDENT>error_msg = str(error.get("<STR_LIT>"))[<NUM_LIT:1>:-<NUM_LIT:1>]<EOL>raise AirflowException(error_msg)<EOL><DEDENT>return<EOL><DEDENT>time.sleep(TIME_TO_SLEEP_IN_SECONDS)<EOL><DEDENT>
Waits for the named operation to complete - checks status of the
asynchronous call.

:param project_id: Project ID of the project that contains the instance.
:type project_id: str
:param operation_name: Name of the operation.
:type operation_name: str
:return: None