(self, source_uris, job_id, blocking=True)
Checks the status of an import based on a job_id.

    Args:
      source_uris: A list of uris of the files to import.  Uris should be in
          the form gs://bucket/object.  These files should contain 1 or more
          newline separated JSON files.
      job_id: The import job_id, used for checking the import status.
      blocking: If True, wait until the import completes.  If False returns
          after checking the status once regardless of the import status.

    Returns:
      True if the status state is DONE, otherwise returns False.
Checks the status of an import based on a job_id.
Checks the status of an import based on a job_id .
def PollImportStatus(self, source_uris, job_id, blocking=True):
    """Checks the status of an import based on a job_id.

    Args:
      source_uris: A list of uris of the files to import.  Uris should be in
          the form gs://bucket/object.  These files should contain 1 or more
          newline separated JSON files.
      job_id: The import job_id, used for checking the import status.
      blocking: If True, wait until the import completes.  If False returns
          after checking the status once regardless of the import status.

    Returns:
      True if the status state is DONE, otherwise returns False.
    """
    try:
      job_collection = self.service.jobs()
      first_pass = True
      # If blocking ping for status until it is done, with a short pause
      # between calls.
      while blocking or first_pass:
        first_pass = False

        request = job_collection.get(projectId=self.project_id, jobId=job_id)
        status = self._ExecuteRequestWithRetries(request)
        if 'DONE' == status['status']['state']:
          if 'errorResult' in status['status']:
            raise BigQueryImportError(
                'Importing the following data failed with the following status'
                '\nstatus:%s\ndata_files:%s' %
                (status, source_uris),
                status['status']['errorResult']['message'])
          else:
            logging.info('Upload complete.')
            return True

        if blocking:
          logging.info('Waiting for the import to complete...')
          time.sleep(SLEEP_BETWEEN_RETRIES)

      return False

    except HttpError as e:
      raise BigQueryError(
          'Checking the status of an import for the following data failed '
          'with the following Http error \nerror:%s\ndata_files:%s' %
          (e, source_uris))
def PollImportStatus ( self , source_uris , job_id , blocking = True ) : try : job_collection = self . service . jobs ( ) first_pass = True # If blocking ping for status until it is done, with a short pause # between calls. while blocking or first_pass : first_pass = False request = job_collection . get ( projectId = self . project_id , jobId = job_id ) status = self . _ExecuteRequestWithRetries ( request ) if 'DONE' == status [ 'status' ] [ 'state' ] : if 'errorResult' in status [ 'status' ] : raise BigQueryImportError ( 'Importing the following data failed with the following status' '\nstatus:%s\ndata_files:%s' % ( status , source_uris ) , status [ 'status' ] [ 'errorResult' ] [ 'message' ] ) else : logging . info ( 'Upload complete.' ) return True if blocking : logging . info ( 'Waiting for the import to complete...' ) time . sleep ( SLEEP_BETWEEN_RETRIES ) return False except HttpError as e : raise BigQueryError ( 'Checking the status of an import for the following data failed ' 'with the following Http error \nerror:%s\ndata_files:%s' % ( e , source_uris ) )