source-linkedin-ads-v2: fix bugs causing missing data #2107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
We received reports of missing data for the
AdCampaignAnalytics
,AdCreativeAnalytics
, andCreatives
streams.Changes in this PR include:
LinkedInAdsAnalyticsStream
State management issues were causing the most recent date from the previous resource to be used as the start date for the next resource. Almost every state management tool exposed by the Airbyte CDK was being used, causing the stream's state to update when it shouldn't. I converted the stream to use the newer
state
property to have finer control of when state is updated.These
LinkedInAdsAnalyticsStream
changes address the missing data issues forAdCampaignAnalytics
andAdCreativeAnalytics
.Creatives
The logic for adding a
creative_name
to each record was causing the connector to not emit a record if an exception occurred trying to fetch thecreative_name
. That logic has been refactored and improved. Improvements include:creative_name
./rest/posts/{encoded_share_urn}
to fetchcreative_name
s since LinkedIn is sunsetting the legacy/v2
endpoints.Snapshot tests
pytest
automatically generates.Workflow steps:
(How does one use this feature, and how has it changed)
Documentation links affected:
(list any documentation links that you created, or existing ones that you've identified as needing updates, along with a brief description)
Notes for reviewers:
Tested on a local stack. Confirmed:
Creatives
andAdCampaignAnalytics
matches up with the expected number of records.AdCreativeAnalytics
is significantly more than the connector was previously receiving.AdCreativeAnalytics
can take 24+ hours to backfill, so I only ran a partial backfill for it. Since bothCreatives
andAdCampaignAnalytics
are now getting the expected number of records &AdCreativeAnalytics
is getting significantly more records than before, I feel fairly confident that the missing data issues are resolved forAdCreativeAnalytics
.creative_name
retrieved from the newer/rest/posts/{encoded_share_urn}
is the same as thecreative_name
retrieved from the legacy/v2
endpoint.All
Ad${resource]Analytics
bindings for existing tasks will need backfilled since how they manage state has changed.This change is