Ejemplo n.º 1
0
    def Display(self, args, job):
        """This method is called to print the result of the Run() method.

    Args:
      args: The arguments that command was run with.
      job: A Job message.
    """
        info = job_display.DisplayInfo(job)
        # Print information in the form of a one-row table:
        list_printer.PrintResourceList('bigquery.jobs.describe', [info])
Ejemplo n.º 2
0
  def Display(self, args, jobs):
    """This method is called to print the result of the Run() method.

    Args:
      args: The arguments that command was run with.
      jobs: The iterator over JobsValueListEntry messages returned from the
        Run()
        method.
    """
    list_printer.PrintResourceList(
        'bigquery.jobs.list',
        [job_display.DisplayInfo(entry) for entry in jobs])
Ejemplo n.º 3
0
    def Display(self, args, job):
        """This method is called to print the result of the Run() method.

    Args:
      args: The arguments that command was run with.
      job: A Job message.

    Raises:
      bigquery.BackendError: if job has failed.
    """
        info = job_display.DisplayInfo(job)
        # Print information in the form of a one-row table:
        list_printer.PrintResourceList('bigquery.jobs.wait', [info])
        if job_control.IsFailedJob(job):
            if args.ignore_error:
                log.err.Print('\nFAILURE (ignored): {0}'.format(
                    job.status.errorResult.message))
            else:
                log.err.Print()
                raise bigquery.BackendError(job.status.errorResult.message,
                                            job.status.errorResult, [],
                                            job.jobReference)