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

fixes pagination implementation for video_ads stream #72

Merged
merged 1 commit into from
Apr 18, 2024
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
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 2.3.1
* Fixes url encoding issue with `video_ads` stream pagination

## 2.3.0

### Features
Expand Down Expand Up @@ -49,7 +52,7 @@

## 1.2.5
* Auto access-token refresh [#41](https://github.com/singer-io/tap-linkedin-ads/pull/41)

## 1.2.4
* Add Request Timeout [#36](https://github.com/singer-io/tap-linkedin-ads/pull/36)
* Handling 4xx responses for adCampaignGroup [#28](https://github.com/singer-io/tap-linkedin-ads/pull/28)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from setuptools import setup, find_packages

setup(name='tap-linkedin-ads',
version='2.3.0',
version='2.3.1',
description='Singer.io tap for extracting data from the LinkedIn Marketing Ads API API 2.0',
author='[email protected]',
classifiers=['Programming Language :: Python :: 3 :: Only'],
Expand Down
5 changes: 3 additions & 2 deletions tap_linkedin_ads/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_next_url(stream_name, next_url, data):
if href:
# url must be kept encoded for the creatives endpoint.
# Ref - https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads/account-structure/create-and-manage-creatives?view=li-lms-2023-01&tabs=http#sample-request-3
if "rest/creatives" in href:
if "rest/creatives" in href or "rest/posts" in href:
return 'https://api.linkedin.com{}'.format(href)
# Prepare next page URL
next_url = 'https://api.linkedin.com{}'.format(urllib.parse.unquote(href))
Expand Down Expand Up @@ -617,7 +617,8 @@ class VideoAds(LinkedInAds):
parent = "accounts"
params = {
"q": "dscAdAccount",
"dscAdTypes": "List(VIDEO)"
"dscAdTypes": "List(VIDEO)",
"count":100
Vi6hal marked this conversation as resolved.
Show resolved Hide resolved
}
headers = {'X-Restli-Protocol-Version': "2.0.0"}

Expand Down