Skip to content

Commit

Permalink
Added relevant search query fields for analytics streams.
Browse files Browse the repository at this point in the history
  • Loading branch information
shantanu73 committed Oct 25, 2023
1 parent 661f1ee commit aa1ec85
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tap_linkedin_ads/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
'endAt',
'creative',
'creativeId',
'pivot',
'pivotValue'
}
NEW_PATH_STREAMS = ["campaign_groups", "campaigns", "creatives"]

Expand Down Expand Up @@ -495,15 +497,15 @@ def sync_ad_analytics(self, client, catalog, last_datetime, date_window_size, pa
# (even if this means the values are all `0`) and a day with null
# values. We found that requesting these fields gives you the days with
# non-null values
first_chunk = [['dateRange', 'pivot', 'pivotValue']]
first_chunk = [['dateRange', 'pivotValues']]

chunks = first_chunk + list(split_into_chunks(valid_selected_fields, MAX_CHUNK_LENGTH))

# We have to append these fields in order to ensure we get them back
# so that we can create the composite primary key for the record and
# to merge the multiple responses based on this primary key
for chunk in chunks:
for field in ['dateRange', 'pivot', 'pivotValue']:
for field in ['dateRange', 'pivotValues']:
if field not in chunk:
chunk.append(field)

Expand Down

0 comments on commit aa1ec85

Please sign in to comment.