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

Cleanup #56

Merged
merged 2 commits into from
May 9, 2022
Merged
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions tap_google_ads/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

LOGGER = singer.get_logger()

REPORTS = [
STREAMS = [
"accessible_bidding_strategy",
"ad_group",
"ad_group_ad",
Expand Down Expand Up @@ -176,12 +176,12 @@ def create_resource_schema(config):
updated_segments = get_segments(resource_schema, resource)
resource["segments"] = updated_segments

for report in REPORTS:
report_object = resource_schema[report]
for stream in STREAMS:
stream_object = resource_schema[stream]
fields = {}
attributes = report_object["attributes"]
metrics = report_object["metrics"]
segments = report_object["segments"]
attributes = stream_object["attributes"]
metrics = stream_object["metrics"]
segments = stream_object["segments"]
for field in attributes + metrics + segments:
field_schema = dict(resource_schema[field])

Expand Down Expand Up @@ -224,7 +224,7 @@ def create_resource_schema(config):
):
field["incompatible_fields"].append(compared_field)

report_object["fields"] = fields
stream_object["fields"] = fields
return resource_schema


Expand Down
6 changes: 0 additions & 6 deletions tap_google_ads/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,8 @@ def extract_field_information(self, resource_schema):

self.behavior[field_name] = field["field_details"]["category"]

self.add_extra_fields(resource_schema)
self.field_exclusions = {k: list(v) for k, v in self.field_exclusions.items()}

def add_extra_fields(self, resource_schema):
"""This function should add fields to `field_exclusions`, `schema`, and
`behavior` that are not covered by Google's resource_schema
"""


def create_full_schema(self, resource_schema):
google_ads_name = self.google_ads_resource_names[0]
Expand Down