Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source-google-analytics-data-api: fix formatting #27011

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@

import pytest
from freezegun import freeze_time
from source_google_analytics_data_api.source import GoogleAnalyticsDataApiBaseStream, PAGE_SIZE
from source_google_analytics_data_api.source import PAGE_SIZE, GoogleAnalyticsDataApiBaseStream

from .utils import read_incremental


json_credentials = """
{
"type": "service_account",
Expand Down Expand Up @@ -90,10 +89,12 @@ def test_request_body_json(patch_base_class):
"dateRanges": [request_body_params["stream_slice"]],
"returnPropertyQuota": True,
"offset": str(0),
"limit": str(PAGE_SIZE)
"limit": str(PAGE_SIZE),
}

request_body_json = GoogleAnalyticsDataApiBaseStream(authenticator=MagicMock(), config=patch_base_class["config"]).request_body_json(**request_body_params)
request_body_json = GoogleAnalyticsDataApiBaseStream(authenticator=MagicMock(), config=patch_base_class["config"]).request_body_json(
**request_body_params
)
assert request_body_json == expected_body_json


Expand Down Expand Up @@ -315,38 +316,38 @@ def test_read_incremental(requests_mock):
"dimensionHeaders": [{"name": "date"}],
"metricHeaders": [{"name": "totalUsers", "type": "TYPE_INTEGER"}],
"rows": [{"dimensionValues": [{"value": "20221229"}], "metricValues": [{"value": "100"}]}],
"rowCount": 1
"rowCount": 1,
},
{
"dimensionHeaders": [{"name": "date"}],
"metricHeaders": [{"name": "totalUsers", "type": "TYPE_INTEGER"}],
"rows": [{"dimensionValues": [{"value": "20221230"}], "metricValues": [{"value": "110"}]}],
"rowCount": 1
"rowCount": 1,
},
{
"dimensionHeaders": [{"name": "date"}],
"metricHeaders": [{"name": "totalUsers", "type": "TYPE_INTEGER"}],
"rows": [{"dimensionValues": [{"value": "20221231"}], "metricValues": [{"value": "120"}]}],
"rowCount": 1
"rowCount": 1,
},
{
"dimensionHeaders": [{"name": "date"}],
"metricHeaders": [{"name": "totalUsers", "type": "TYPE_INTEGER"}],
"rows": [{"dimensionValues": [{"value": "20230101"}], "metricValues": [{"value": "130"}]}],
"rowCount": 1
"rowCount": 1,
},
{
"dimensionHeaders": [{"name": "date"}],
"metricHeaders": [{"name": "totalUsers", "type": "TYPE_INTEGER"}],
"rows": [{"dimensionValues": [{"value": "20230101"}], "metricValues": [{"value": "140"}]}],
"rowCount": 1
"rowCount": 1,
},
{
"dimensionHeaders": [{"name": "date"}],
"metricHeaders": [{"name": "totalUsers", "type": "TYPE_INTEGER"}],
"rows": [{"dimensionValues": [{"value": "20230102"}], "metricValues": [{"value": "150"}]}],
"rowCount": 1
}
"rowCount": 1,
},
]

requests_mock.register_uri(
Expand Down