google/cloud/bigquery/job.py
def from_api_repr(cls, resource, client):
        """Factory:  construct a job given its API representation

        .. note:

           This method assumes that the project found in the resource matches
           the client's project.

        :type resource: dict
        :param resource: dataset job representation returned from the API

        :type client: :class:`google.cloud.bigquery.client.Client`
        :param client: Client which holds credentials and project
                       configuration for the dataset.

        :rtype: :class:`google.cloud.bigquery.job.CopyJob`
        :returns: Job parsed from ``resource``.
        """
        job_id, config_resource = cls._get_resource_config(resource)
        config = CopyJobConfig.from_api_repr(config_resource)
        destination = TableReference.from_api_repr(
            config_resource['destinationTable'])
        sources = []
        source_configs = config_resource.get('sourceTables')
        if source_configs is None:
            single = config_resource.get('sourceTable')
            if single is None:
                raise KeyError(
                    "Resource missing 'sourceTables' / 'sourceTable'")
            source_configs = [single]
        for source_config in source_configs:
            table_ref = TableReference.from_api_repr(source_config)
            sources.append(table_ref)
        job = cls(
            job_id, sources, destination, client=client, job_config=config)
        job._set_properties(resource)
        return job
Factory:  construct a job given its API representation

        .. note:

           This method assumes that the project found in the resource matches
           the client's project.

        :type resource: dict
        :param resource: dataset job representation returned from the API

        :type client: :class:`google.cloud.bigquery.client.Client`
        :param client: Client which holds credentials and project
                       configuration for the dataset.

        :rtype: :class:`google.cloud.bigquery.job.CopyJob`
        :returns: Job parsed from ``resource``.
        
construct a job given its API representation
note.

This method assumes that the project found in the resource matches
the client's project.
construct a job given its API representation note . This method assumes that the project found in the resource matches the client ' s project .
def from_api_repr(cls, resource, client):
        job_id, config_resource = cls._get_resource_config(resource)
        config = CopyJobConfig.from_api_repr(config_resource)
        destination = TableReference.from_api_repr(
            config_resource['destinationTable'])
        sources = []
        source_configs = config_resource.get('sourceTables')
        if source_configs is None:
            single = config_resource.get('sourceTable')
            if single is None:
                raise KeyError(
                    "Resource missing 'sourceTables' / 'sourceTable'")
            source_configs = [single]
        for source_config in source_configs:
            table_ref = TableReference.from_api_repr(source_config)
            sources.append(table_ref)
        job = cls(
            job_id, sources, destination, client=client, job_config=config)
        job._set_properties(resource)
        return job
def from_api_repr ( cls , resource , client ) : job_id , config_resource = cls . _get_resource_config ( resource ) config = CopyJobConfig . from_api_repr ( config_resource ) destination = TableReference . from_api_repr ( config_resource [ 'destinationTable' ] ) sources = [ ] source_configs = config_resource . get ( 'sourceTables' ) if source_configs is None : single = config_resource . get ( 'sourceTable' ) if single is None : raise KeyError ( "Resource missing 'sourceTables' / 'sourceTable'" ) source_configs = [ single ] for source_config in source_configs : table_ref = TableReference . from_api_repr ( source_config ) sources . append ( table_ref ) job = cls ( job_id , sources , destination , client = client , job_config = config ) job . _set_properties ( resource ) return job
Factory:  construct a job given its API representation
.. note:
Factory : construct a job given its API representation .. note :
"""Factory:  construct a job given its API representation

        .. note:

           This method assumes that the project found in the resource matches
           the client's project.

        :type resource: dict
        :param resource: dataset job representation returned from the API

        :type client: :class:`google.cloud.bigquery.client.Client`
        :param client: Client which holds credentials and project
                       configuration for the dataset.

        :rtype: :class:`google.cloud.bigquery.job.CopyJob`
        :returns: Job parsed from ``resource``.
        """
Job parsed from ``resource``.
Job parsed from ` ` resource ` ` .
:class:`google.cloud.bigquery.job.CopyJob`
cls
resource
dataset job representation returned from the API
dataset job representation returned from the API
client
Client which holds credentials and project
configuration for the dataset.
Client which holds credentials and project configuration for the dataset .