dataquery.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:pypi-download-stats 作者: jantman 项目源码 文件源码
def _get_bigquery_service(self):
        """
        Connect to the BigQuery service.

        Calling ``GoogleCredentials.get_application_default`` requires that
        you either be running in the Google Cloud, or have the
        ``GOOGLE_APPLICATION_CREDENTIALS`` environment variable set to the path
        to a credentials JSON file.

        :return: authenticated BigQuery service connection object
        :rtype: `googleapiclient.discovery.Resource <http://google.github.io/\
google-api-python-client/docs/epy/googleapiclient.discovery.\
Resource-class.html>`_
        """
        logger.debug('Getting Google Credentials')
        credentials = GoogleCredentials.get_application_default()
        logger.debug('Building BigQuery service instance')
        bigquery_service = build('bigquery', 'v2', credentials=credentials)
        return bigquery_service
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号