Module Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr decorator_list decorator_list ClassDef bases body Expr Str Assign NameStore Str Assign NameStore NameLoad Assign NameStore ListLoad Num Num Assign NameStore Str decorator_list ClassDef bases body FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str keyword Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr If BoolOpOr CompareIs NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad Str Str keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr If CompareEq SubscriptLoad NameLoad Index Str Num body Raise Call NameLoad orelse Assign NameStore SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Num Index Str Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad Assign NameStore NameLoad Assign NameStore NameLoad While BoolOpOr NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Call NameLoad NameLoad Assign NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Num Assign NameStore Dict Str Str Str Str AttributeLoad NameLoad attr NameLoad NameLoad Num If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore Num While NameLoad body TryExcept body Return Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body If CompareGt NameLoad Num body Assign NameStore Num Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AugAssignSub NameStore Num orelse Raise NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr handlers ExceptHandler type NameLoad name NameStore body If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num body Raise Call NameLoad orelse If CompareEq AttributeLoad AttributeLoad NameLoad attr attr Num body Raise Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Raise Call NameLoad Str NameLoad ExceptHandler type NameLoad name NameStore body Raise Call NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad If CompareEq Call NameLoad SubscriptLoad NameLoad Index Str Num body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Return TupleLoad NameLoad NameLoad Assign NameStore ListComp SubscriptLoad NameLoad Index Str comprehension NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Str For NameStore SubscriptLoad NameLoad Index Str body Assign NameStore Call NameLoad Call NameLoad NameLoad ListComp SubscriptLoad NameLoad Index Str comprehension NameStore SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str orelse Assign NameStore NameLoad Return TupleLoad NameLoad NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr handlers ExceptHandler type TupleLoad NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr name NameStore body Raise Call NameLoad Str NameLoad Return NameLoad decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore NameLoad TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Dict Str Dict Str Dict Str NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad attr Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Str handlers ExceptHandler type TupleLoad NameLoad AttributeLoad NameLoad attr name NameStore body Raise Call NameLoad Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Assign NameStore BoolOpOr NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad Str attr Call NameLoad NameLoad Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad NameLoad While NameLoad body TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad attr handlers ExceptHandler type TupleLoad NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr name NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad NameLoad Assign NameStore NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad Call AttributeLoad BinOpSub Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr If CompareEq SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Num orelse If CompareEq SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Num orelse If BoolOpAnd CompareEq SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Str CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Expr Call NameLoad NameLoad keyword NameLoad Break orelse Raise Call NameLoad Str Return NameLoad decorator_list decorator_list
N/A N/A datetime N/A httplib N/A httplib2 N/A logging N/A os N/A time ssl SSLError apiclient.discovery build apiclient.errors HttpError oauth2client.client flow_from_clientsecrets oauth2client.file Storage oauth2client.tools run_flow BigQueryError N/A Exception N/A N/A N/A BigQueryJobFailure N/A BigQueryError N/A N/A Indicates that a BigQuery job's result was retrieved, but the query failed.

    Raised when BigQuery reports a job has failed. Additional attempts to
    retrieve the job status will not change the result.
     __init__ N/A N/A self http_code cause N/A N/A N/A N/A self code http_code N/A N/A N/A N/A super BigQueryJobFailure self __init__ cause N/A N/A BigQueryCommunicationError N/A BigQueryError N/A N/A An error occurred trying to communicate with BigQuery

    This error is raised when the application fails to communicate with BigQuery.
    It does not indicate that the result of the query itself failed, but rather
    that the result of the query is indeterminate because the application failed
    to retrieve status from BigQuery.
     __init__ N/A N/A self message cause N/A N/A N/A N/A self cause cause N/A N/A N/A N/A super BigQueryCommunicationError self __init__ N/A %s (%s) N/A message N/A self cause N/A N/A TableDoesNotExist N/A BigQueryError N/A __init__ N/A N/A self N/A N/A N/A N/A N/A N/A super TableDoesNotExist self __init__ N/A N/A APIConfigError N/A BigQueryError N/A __init__ N/A N/A self N/A N/A N/A N/A N/A N/A super APIConfigError self __init__ N/A N/A GoogleAPIAuthConfig N/A N/A N/A Google API requires an object with preferences for logging and
    authentication. Rather than pass with argparse, for now we manually
    build the default configurations to pass directly. Not guaranteed to
    stay in the future.

     N/A logging_level ERROR N/A noauth_local_webserver False N/A auth_host_port N/A 8080 8090 N/A auth_host_name localhost N/A GoogleAPIAuth N/A N/A __init__ N/A N/A self credentials_filepath is_headless N/A False N/A N/A N/A self logger N/A N/A logging getLogger telescope N/A N/A self credentials_filepath credentials_filepath N/A N/A N/A self _set_headless_mode is_headless N/A N/A self project_id N/A N/A self _find_project_id_opportunistically N/A _set_headless_mode N/A N/A self is_headless N/A N/A N/A N/A GoogleAPIAuthConfig noauth_local_webserver is_headless N/A authenticate_with_google N/A N/A self N/A N/A N/A flow N/A flow_from_clientsecrets N/A N/A N/A os path join N/A N/A N/A os path dirname __file__ resources/client_secrets.json scope https://www.googleapis.com/auth/bigquery N/A storage N/A Storage N/A self credentials_filepath N/A credentials N/A N/A storage get N/A http N/A N/A httplib2 Http N/A N/A N/A credentials None N/A credentials invalid N/A N/A credentials N/A run_flow flow flow storage storage flags GoogleAPIAuthConfig http http N/A N/A N/A N/A self logger info Successfully authenticated with Google, moving on to building query. N/A http N/A N/A credentials authorize http N/A N/A build bigquery v2 http http N/A _find_project_id_opportunistically N/A N/A self N/A N/A N/A authenticated_service N/A N/A self authenticate_with_google N/A projects_handler N/A N/A authenticated_service projects N/A projects_list N/A N/A N/A N/A projects_handler list execute N/A N/A N/A projects_list N/A totalItems 0 N/A N/A N/A APIConfigError N/A N/A project_numeric_id N/A N/A N/A projects_list N/A projects N/A 0 N/A numericId N/A project_numeric_id N/A N/A BigQueryJobResultCollector N/A object N/A N/A Collect the results from a BigQuery job. __init__ N/A N/A self jobs_service project_id N/A N/A N/A Class to collect the results from a BigQuery job when the job completes.

        Args:
            jobs_service: BigQuery jobs service instance.
            project_id: (int) ID of project for which to retrieve results.
         N/A N/A self logger N/A N/A logging getLogger telescope N/A N/A self _jobs_service jobs_service N/A N/A self _project_id project_id N/A collect_results N/A N/A self job_id N/A N/A N/A Wait until a job is complete and gather all results.

        Args:
            job_id: (str) Job ID for which to retrieve results.

        Returns:
            (list) A list of result rows from the completed BigQuery job.
         N/A collected_rows N/A N/A is_first_chunk True N/A page_token None N/A N/A is_first_chunk page_token N/A N/A results_response N/A N/A self _wait_for_results_chunk job_id page_token N/A N/A results_chunk page_token N/A N/A self _parse_query_results_response results_response N/A N/A N/A collected_rows extend results_chunk N/A page_token N/A N/A N/A N/A N/A self logger debug Query contains additional results (found %d rows so far). Fetching additional rows with new page token. N/A len collected_rows N/A is_first_chunk False N/A collected_rows N/A _wait_for_results_chunk N/A N/A self job_id page_token N/A N/A N/A Retrieve a single chunk of results from a completed BigQuery job.

        Retrieve a fixed number of BigQuery result rows, where the number
        requested may be greater or less than the total number of rows
        available.

        Args:
            job_id: (str) Job ID for which to retrieve results.
            page_token: Token that indicates which page of results for which to
                retrieve results or None to retrieve the first page of results.

        Returns:
            (list) A list of result rows in the current chunk of results.
         N/A MAX_RESULTS_PER_GET 100000 N/A query_request N/A projectId jobId maxResults timeoutMs N/A self _project_id job_id MAX_RESULTS_PER_GET 0 N/A N/A page_token None N/A N/A N/A query_request N/A pageToken page_token N/A retries_remaining 4 N/A True N/A N/A N/A N/A N/A N/A self _execute_job_query query_request N/A N/A N/A BigQueryCommunicationError N/A e N/A N/A N/A retries_remaining 0 N/A N/A sleep_seconds 10 N/A N/A N/A logging warning Failed to communicate with BigQuery to retrieve job %s. Retrying in %d seconds... (%d attempts remaining) job_id sleep_seconds retries_remaining N/A N/A N/A time sleep sleep_seconds N/A retries_remaining 1 N/A N/A e N/A _execute_job_query N/A N/A self bq_query N/A N/A N/A Executes a query to retrieve BigQuery query results.

        Args:
            bq_query: (dict) Parameter set of the query to execute.

        Returns:
            (dict) The result of the query in the form of a dictionary.

        Raises:
            TableDoesNotExist: Query specified a table that does not exist.
            BigQueryJobFailure: The job completed, but the query failed.
            BigQueryCommunicationError: Could not communicate with BigQuery.
         N/A N/A N/A N/A N/A N/A N/A N/A self _jobs_service getQueryResults bq_query execute N/A N/A N/A HttpError N/A e N/A N/A N/A N/A N/A e resp status 404 N/A N/A N/A TableDoesNotExist N/A N/A N/A N/A N/A e resp status 400 N/A N/A N/A BigQueryJobFailure N/A N/A e resp status e N/A N/A N/A BigQueryCommunicationError Failed to communicate with BigQuery e N/A N/A Exception N/A e N/A N/A N/A BigQueryCommunicationError Failed to communicate with BigQuery e N/A _parse_query_results_response N/A N/A self results_response N/A N/A N/A Parse the response dictionary from BigQuery.

        Parse the response dictionary from BigQuery into result rows and a page
        token.

        Args:
            results_response: A response dictionary from BigQuery representing the
                results of a BigQuery query job.

        Returns:
          (list, token) A two-tuple where the first element is a list of result
          rows in the format:

            [{'fieldA': 'valueA1', 'fieldB': 'valueB1'}, # row 1
             {'fieldA': 'valueA2', 'fieldB': 'valueB2'}] # row 2

          and the second element is a page token indicating the next page of
          results or None if there are no more results available.
         N/A parsed_rows N/A N/A N/A N/A int N/A results_response N/A totalRows 0 N/A N/A N/A N/A N/A self logger warn BigQuery query completed successfully, but result contained no rows. N/A N/A parsed_rows None N/A fields N/A N/A field N/A name N/A field N/A N/A results_response N/A schema N/A fields N/A results_row N/A results_response N/A rows N/A N/A parsed_row N/A dict N/A zip fields N/A N/A result_value N/A v N/A result_value N/A results_row N/A f N/A N/A N/A parsed_rows append parsed_row N/A N/A pageToken results_response N/A N/A page_token N/A results_response N/A pageToken N/A N/A page_token None N/A N/A parsed_rows page_token N/A N/A get_authenticated_service N/A N/A google_auth_config N/A N/A N/A N/A N/A authenticated_service N/A N/A google_auth_config authenticate_with_google N/A N/A N/A N/A SSLError HttpError N/A httplib2 ServerNotFoundError N/A httplib ResponseNotReady N/A e N/A N/A N/A BigQueryCommunicationError Failed to communicate with BigQuery during authentication e N/A authenticated_service N/A BigQueryCall N/A object N/A __init__ N/A N/A self authenticated_service project_id N/A N/A N/A N/A self logger N/A N/A logging getLogger telescope N/A N/A self _authenticated_service authenticated_service N/A N/A self _project_id project_id N/A retrieve_job_data N/A N/A self job_id N/A N/A N/A result_collector N/A BigQueryJobResultCollector N/A N/A N/A self _authenticated_service jobs N/A self _project_id N/A N/A N/A result_collector collect_results job_id N/A run_asynchronous_query N/A N/A self query_string N/A N/A N/A job_reference_id None N/A N/A N/A job_collection N/A N/A N/A self _authenticated_service jobs N/A job_definition N/A configuration N/A query N/A query query_string N/A job_collection_insert N/A N/A N/A N/A job_collection insert projectId N/A self _project_id body job_definition execute N/A job_reference_id N/A N/A job_collection_insert N/A jobReference N/A jobId N/A N/A N/A N/A HttpError N/A httplib ResponseNotReady N/A e N/A N/A N/A BigQueryCommunicationError Failed to communicate with BigQuery e N/A job_reference_id N/A monitor_query_queue N/A N/A self job_id job_metadata query_object callback_function N/A None None N/A N/A query_object N/A query_object self N/A started_checking N/A N/A N/A datetime datetime utcnow N/A notification_identifier N/A N/A ,  join N/A filter None N/A N/A job_metadata values N/A N/A N/A N/A self logger info Queued request for %s, received job id: %s notification_identifier job_id N/A True N/A N/A N/A N/A job_collection N/A N/A N/A query_object _authenticated_service jobs N/A job_collection_state N/A N/A N/A N/A job_collection get projectId N/A self _project_id jobId job_id execute N/A N/A N/A N/A SSLError Exception AttributeError HttpError N/A httplib2 ServerNotFoundError N/A caught_error N/A N/A N/A N/A N/A self logger warn Encountered error (%s) monitoring for %s, could be temporary, not bailing out. caught_error notification_identifier N/A job_collection_state None N/A N/A job_collection_state None N/A N/A time_waiting N/A int N/A N/A N/A N/A N/A N/A datetime datetime utcnow started_checking total_seconds N/A N/A N/A N/A job_collection_state N/A status N/A state RUNNING N/A N/A N/A N/A N/A self logger info Waiting for %s to complete, spent %d seconds so far. notification_identifier time_waiting N/A N/A N/A time sleep 10 N/A N/A N/A N/A N/A job_collection_state N/A status N/A state PENDING N/A N/A N/A N/A N/A self logger info Waiting for %s to submit, spent %d seconds so far. notification_identifier time_waiting N/A N/A N/A time sleep 60 N/A N/A N/A N/A N/A N/A job_collection_state N/A status N/A state DONE N/A callback_function None N/A N/A N/A N/A N/A self logger info Found completion status for %s. notification_identifier N/A N/A callback_function job_id query_object self N/A N/A N/A N/A Exception UnknownBigQueryResponse N/A None N/A N/A