-
Notifications
You must be signed in to change notification settings - Fork 4.5k
🚨🚨 Source Linkedin Ads: Update pivotValues pk type for Ad Analytics streams #37531
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
Changes from 5 commits
8515a79
7709847
598f311
bfab168
3ce46e3
1f88eab
5f8ccdd
44e5e2e
a2e5144
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -305,6 +305,12 @@ def transform_col_names(record: Dict, dict_keys: list = []) -> Mapping[str, Any] | |
return record | ||
|
||
|
||
def transform_pivot_values(record: Dict) -> Mapping[str, Any]: | ||
pivot_values = record.get("pivotValues", []) | ||
record["string_of_pivot_values"] = ",".join(pivot_values) | ||
return record | ||
|
||
|
||
def transform_data(records: List) -> Iterable[Mapping]: | ||
""" | ||
We need to transform the nested complex data structures into simple key:value pair, | ||
|
@@ -323,6 +329,9 @@ def transform_data(records: List) -> Iterable[Mapping]: | |
if "variables" in record: | ||
record = transform_variables(record) | ||
|
||
if "pivotValues" in record: | ||
record = transform_pivot_values(record) | ||
Comment on lines
+332
to
+333
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This 'if' implies that one of the primary keys for the stream can be null. Is it the case that at least the other PK, end_date, will always be non-null? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method is common for all streams, so non ad-analytics streams doesn't have pivotValues field. ad-analytics streams always have pivotValues and end_date. |
||
|
||
record = transform_col_names(record, DESTINATION_RESERVED_KEYWORDS) | ||
|
||
yield record |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,36 @@ | ||
# LinkedIn Ads Migration Guide | ||
|
||
## Upgrading to 2.0.0 | ||
|
||
Version 2.0.0 introduces changes in the primary key selected for all *-analytics streams (including custom ones). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add this also: This upgrade changes primary key for *-analytics streams from pivotValues[array of strings] to string_of_pivot_values[string]. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
|
||
- "ad_campaign_analytics" | ||
- "ad_creative_analytics" | ||
- "ad_impression_device_analytics" | ||
- "ad_member_company_size_analytics" | ||
- "ad_member_country_analytics" | ||
- "ad_member_job_function_analytics" | ||
- "ad_member_job_title_analytics" | ||
- "ad_member_industry_analytics" | ||
- "ad_member_seniority_analytics" | ||
- "ad_member_region_analytics" | ||
- "ad_member_company_analytics" | ||
|
||
## Migration Steps | ||
|
||
Clearing your data is required for the affected streams in order to continue syncing successfully. To clear your data for the affected streams, follow the steps below: | ||
|
||
1. Select **Connections** in the main navbar and select the connection(s) affected by the update. | ||
2. Select the **Schema** tab. | ||
1. Select **Refresh source schema** to bring in any schema changes. Any detected schema changes will be listed for your review. | ||
2. Select **OK** to approve changes. | ||
3. Select **Save changes** at the bottom of the page. | ||
1. Ensure the **Clear affected streams** option is checked to ensure your streams continue syncing successfully with the new schema. | ||
4. Select **Save connection**. | ||
|
||
This will clear the data in your destination for the subset of streams with schema changes. After the clear succeeds, trigger a sync by clicking **Sync Now**. For more information on clearing your data in Airbyte, see [this page](https://docs.airbyte.com/operator-guides/reset). | ||
|
||
|
||
## Upgrading to 1.0.0 | ||
|
||
Version 1.0.0 introduces changes in the primary key selected for all *-analytics streams (including custom ones). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This upgrade changes primary key for *-analytics streams from pivotValues[array of strings] to string_of_pivot_values[string] so that it is compatible with more destination types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated