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

[TDL-24367] Fix streams implementation #64

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

shantanu73
Copy link

@shantanu73 shantanu73 commented Oct 25, 2023

Description of change

JIRA

  1. Upgraded LinkedIn API version from 202302 to 202309
  2. Schema changes for video_ads stream
  3. Modified path for streams campaign_groups, campaigns & creatives to include /adAccounts/
  4. Added logic to iterate over each accountID in config.json for above mentioned streams
  5. Changed base path from "adDirectSponsoredContents" to "posts" for video_ads stream due to API upgrade
  6. Changed primary key from "content_reference" to "id" for video_ads stream due to API upgrade
  7. Changed replication key from "last_modified_time" to "last_modified_at" for video_ads stream due to API upgrade
  8. Fixed search & sort parameters for account_users & campaigns streams.
  9. Removed the account filter "search_account_values_param".
  10. Added config param for sync_endpoint method.
  11. Added transform logic for AdContext fields.
  12. Removed pivot & pivotValue fields and added pivotValues field for Ad Analytics streams.

Manual QA steps

  • Ran discovery & sync in local dev environment
  • Generated target csv files to validate replicated data

Risks

  • API upgrade changes can cause video_ads, ad_analytics_by_creative, ad_analytics_by_campaign streams to fail

Rollback steps

  • revert this branch

1) Changed LinkedIn API version to 202309.
2) Removed logic to add account parameter for streams with account filter search_account_param.
1) Added logic to iterate over each account and use modified url for campaigns, campaigngroups & creatives APIs.
2) Added X-Restli-Protocol-Version header & modified params fir campaigns & campaigngroups APIs.
3
) Removed account_filter for campaigns & campaigngroups APIs.
4) Added a new parameter config for sync_endpoint method.
1) Added new schema for video_ads stream.
2) Modified enpoint and query params for video_ads stream.
3) Removed transform logic to flatten video_ads schema for change_audit_stamps fields.
1) Modified schema for video_ads stream.
2) Added transform logic to add ad_context fields to root level.
Comment on lines 317 to 319
if self.tap_stream_id in NEW_PATH_STREAMS:
querystring = '&'.join(['%s=%s' % (key, value) for (key, value) in endpoint_params.items()])
account_list = config['accounts'].replace(" ", "").split(",")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is adds a child stream dependancy in the parent class, sync_endpoint method should be modified in the child class.

1) Added get_config() method in LinkedInClient class to fetch config json.
2) Updated usage of get_config() method in discover & sync for tap.
1) Fixed unit tests as per the new config param changes in LinkedinClient class.
2) Made changes in check_accounts() method as per config param changes.
3) Fixed unit tests as per changes in check_accounts() method.
1) Fixed dangerous default value pylint error in LinkedinClient class for config parameter.
2) Fixed unit tests as per above change.
* Changes:
1. Fixed video_ads metadata.
2. Fixed all fields & automatic fields tests.

* Removed analytics streams from start_date, automatic_fields & bookmarks tests.

* Fixed Parent child independent test for Ad analytics streams.

* Removed unnecessary fields.

* Removed beta fields from KNOWN_MISSING_FIELDS in All fields test for ad analytics streams.

* Changes:
1) Added comment mentioning why the Ad Analytics streams were removed from testing.
2) Removed unneccary whitespace.

* Fixed formatting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants