python-bigquery-pandas icon indicating copy to clipboard operation
python-bigquery-pandas copied to clipboard

tests.system.test_gbq.TestReadGBQIntegration: test_ddl_w_max_results failed

Open flaky-bot[bot] opened this issue 3 years ago • 1 comments

This test failed!

To configure my behavior, see the Flaky Bot documentation.

If I'm commenting on this issue too often, add the flakybot: quiet label and I will stop commenting.


commit: 645b6d2a994e36beacf6694bb3c7c1e654fb47f2 buildURL: Build Status, Sponge status: failed

Test output
self = 
random_dataset = Dataset(DatasetReference('precise-truck-742', 'python_bigquery_pandas_tests_system_20220728130250_a94488'))
project_id = 'precise-truck-742'
def test_ddl_w_max_results(self, random_dataset, project_id):
    df = gbq.read_gbq(
        "CREATE OR REPLACE TABLE {}.test_ddl (x INT64)".format(
            random_dataset.dataset_id
        ),
      max_results=0,
    )

tests/system/test_gbq.py:299:


pandas_gbq/gbq.py:926: in read_gbq dtypes=dtypes, pandas_gbq/gbq.py:527: in run_query query_reply.destination, max_results=max_results .nox/system-3-7/lib/python3.7/site-packages/google/cloud/bigquery/client.py:2870: in list_rows table = self.get_table(table.reference, retry=retry, timeout=timeout) .nox/system-3-7/lib/python3.7/site-packages/google/cloud/bigquery/client.py:758: in get_table retry, method="GET", path=table_ref.path, timeout=timeout .nox/system-3-7/lib/python3.7/site-packages/google/cloud/bigquery/client.py:578: in _call_api return call() .nox/system-3-7/lib/python3.7/site-packages/google/api_core/retry.py:291: in retry_wrapped_func on_error=on_error, .nox/system-3-7/lib/python3.7/site-packages/google/api_core/retry.py:189: in retry_target return target()


self = <google.cloud.bigquery._http.Connection object at 0x7fcede518c10> method = 'GET' path = '/projects/precise-truck-742/datasets/python_bigquery_pandas_tests_system_20220728130250_a94488/tables/test_ddl' query_params = None, data = None, content_type = None, headers = None api_base_url = None, api_version = None, expect_json = True _target_object = None, timeout = None

def api_request(
    self,
    method,
    path,
    query_params=None,
    data=None,
    content_type=None,
    headers=None,
    api_base_url=None,
    api_version=None,
    expect_json=True,
    _target_object=None,
    timeout=_DEFAULT_TIMEOUT,
):
    """Make a request over the HTTP transport to the API.

    You shouldn't need to use this method, but if you plan to
    interact with the API using these primitives, this is the
    correct one to use.

    :type method: str
    :param method: The HTTP method name (ie, ``GET``, ``POST``, etc).
                   Required.

    :type path: str
    :param path: The path to the resource (ie, ``'/b/bucket-name'``).
                 Required.

    :type query_params: dict or list
    :param query_params: A dictionary of keys and values (or list of
                         key-value pairs) to insert into the query
                         string of the URL.

    :type data: str
    :param data: The data to send as the body of the request. Default is
                 the empty string.

    :type content_type: str
    :param content_type: The proper MIME type of the data provided. Default
                         is None.

    :type headers: dict
    :param headers: extra HTTP headers to be sent with the request.

    :type api_base_url: str
    :param api_base_url: The base URL for the API endpoint.
                         Typically you won't have to provide this.
                         Default is the standard API base URL.

    :type api_version: str
    :param api_version: The version of the API to call.  Typically
                        you shouldn't provide this and instead use
                        the default for the library.  Default is the
                        latest API version supported by
                        google-cloud-python.

    :type expect_json: bool
    :param expect_json: If True, this method will try to parse the
                        response as JSON and raise an exception if
                        that cannot be done.  Default is True.

    :type _target_object: :class:`object`
    :param _target_object:
        (Optional) Protected argument to be used by library callers. This
        can allow custom behavior, for example, to defer an HTTP request
        and complete initialization of the object at a later time.

    :type timeout: float or tuple
    :param timeout: (optional) The amount of time, in seconds, to wait
        for the server response.

        Can also be passed as a tuple (connect_timeout, read_timeout).
        See :meth:`requests.Session.request` documentation for details.

    :raises ~google.cloud.exceptions.GoogleCloudError: if the response code
        is not 200 OK.
    :raises ValueError: if the response content type is not JSON.
    :rtype: dict or str
    :returns: The API response payload, either as a raw string or
              a dictionary if the response is valid JSON.
    """
    url = self.build_api_url(
        path=path,
        query_params=query_params,
        api_base_url=api_base_url,
        api_version=api_version,
    )

    # Making the executive decision that any dictionary
    # data will be sent properly as JSON.
    if data and isinstance(data, dict):
        data = json.dumps(data)
        content_type = "application/json"

    response = self._make_request(
        method=method,
        url=url,
        data=data,
        content_type=content_type,
        headers=headers,
        target_object=_target_object,
        timeout=timeout,
    )

    if not 200 <= response.status_code < 300:
      raise exceptions.from_http_response(response)

E google.api_core.exceptions.Forbidden: 403 GET https://bigquery.googleapis.com/bigquery/v2/projects/precise-truck-742/datasets/python_bigquery_pandas_tests_system_20220728130250_a94488/tables/test_ddl?prettyPrint=false: Access Denied: Table precise-truck-742:python_bigquery_pandas_tests_system_20220728130250_a94488.test_ddl: Permission bigquery.tables.get denied on table precise-truck-742:python_bigquery_pandas_tests_system_20220728130250_a94488.test_ddl (or it may not exist).

.nox/system-3-7/lib/python3.7/site-packages/google/cloud/_http.py:484: Forbidden

flaky-bot[bot] avatar Jul 28 '22 13:07 flaky-bot[bot]

Looks like this issue is flaky. :worried:

I'm going to leave this open and stop commenting.

A human should fix and close this.


When run at the same commit (645b6d2a994e36beacf6694bb3c7c1e654fb47f2), this test passed in one build (Build Status, Sponge) and failed in another build (Build Status, Sponge).

flaky-bot[bot] avatar Jul 28 '22 13:07 flaky-bot[bot]

I don't see this particular failure in the latest CI tests, but it may be masked by https://github.com/googleapis/python-bigquery-pandas/issues/545.

brijk7 avatar Aug 15 '22 01:08 brijk7

Tests are currently passing. Appears to have been fixed by a recent PR that changed the origin of the data set being used.

chalmerlowe avatar Sep 02 '22 16:09 chalmerlowe