:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(warehouse_sources): support LinkedIn Ads API version 202610 (#119183)
Tom Owersfa931ce0c920
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/linkedin_ads/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/linkedin_ads/source.pyindex 90c9a87b6f62..2d914af98e0b 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/linkedin_ads/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/linkedin_ads/source.py@@ -63,6 +63,7 @@ LINKEDIN_ADS_VERSION_202606 = "202606"LINKEDIN_ADS_VERSION_202607 = "202607"LINKEDIN_ADS_VERSION_202608 = "202608"LINKEDIN_ADS_VERSION_202609 = "202609"+LINKEDIN_ADS_VERSION_202610 = "202610"# Opaque source version label -> LinkedIn API version header. The legacy `v1` pin keeps sending the# header it always has (`API_VERSION`), so existing syncs are byte-for-byte unchanged.@@ -72,6 +73,7 @@ _API_HEADER_BY_VERSION = {LINKEDIN_ADS_VERSION_202607: LINKEDIN_ADS_VERSION_202607,LINKEDIN_ADS_VERSION_202608: LINKEDIN_ADS_VERSION_202608,LINKEDIN_ADS_VERSION_202609: LINKEDIN_ADS_VERSION_202609,+ LINKEDIN_ADS_VERSION_202610: LINKEDIN_ADS_VERSION_202610,}@@ -92,8 +94,9 @@ class LinkedInAdsSource(ResumableSource[LinkedinAdsSourceConfig, LinkedInAdsResuLINKEDIN_ADS_VERSION_202607,LINKEDIN_ADS_VERSION_202608,LINKEDIN_ADS_VERSION_202609,+ LINKEDIN_ADS_VERSION_202610,)- default_version = LINKEDIN_ADS_VERSION_202609+ default_version = LINKEDIN_ADS_VERSION_202610# LinkedIn supports each version for a minimum of one year, then starts rejecting it with a 426# `NONEXISTENT_VERSION` (see `get_non_retryable_errors`). The legacy `v1` pin sends the header it# always has (202508, August 2025 — `_API_HEADER_BY_VERSION`), which reached that one-year mark;diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/linkedin_ads/tests/test_linkedin_client.py b/products/warehouse_sources/backend/temporal/data_imports/sources/linkedin_ads/tests/test_linkedin_client.pyindex 4fdffa684555..842b558650f9 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/linkedin_ads/tests/test_linkedin_client.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/linkedin_ads/tests/test_linkedin_client.py@@ -46,7 +46,7 @@ class TestLinkedinAdsClient:assert result == [{"id": "123", "name": "Test Account"}]mock_client_instance.finder.assert_called_once()- @pytest.mark.parametrize("api_version", ["202508", "202606", "202607", "202608", "202609"])+ @pytest.mark.parametrize("api_version", ["202508", "202606", "202607", "202608", "202609", "202610"])@mock.patch("products.warehouse_sources.backend.temporal.data_imports.sources.linkedin_ads.client.RestliClient")def test_request_sends_configured_api_version(self, mock_restli_client, api_version):"""The configured version must reach the Restli `version_string`, else every request hitsdiff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/linkedin_ads/tests/test_linkedin_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/linkedin_ads/tests/test_linkedin_source.pyindex 99e2bbcbadc0..3d348ba03c80 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/linkedin_ads/tests/test_linkedin_source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/linkedin_ads/tests/test_linkedin_source.py@@ -16,6 +16,7 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.linkedin_aLINKEDIN_ADS_VERSION_202607,LINKEDIN_ADS_VERSION_202608,LINKEDIN_ADS_VERSION_202609,+ LINKEDIN_ADS_VERSION_202610,LinkedInAdsSource,)@@ -89,20 +90,21 @@ class TestLinkedInAdsSource:retryable_errors = self.source.get_retryable_errors()assert not any(pattern in other_error for pattern in retryable_errors)- def test_defaults_new_sources_to_202609(self):- assert self.source.default_version == LINKEDIN_ADS_VERSION_202609+ def test_defaults_new_sources_to_202610(self):+ assert self.source.default_version == LINKEDIN_ADS_VERSION_202610assert set(self.source.supported_versions) == {"v1",LINKEDIN_ADS_VERSION_202606,LINKEDIN_ADS_VERSION_202607,LINKEDIN_ADS_VERSION_202608,LINKEDIN_ADS_VERSION_202609,+ LINKEDIN_ADS_VERSION_202610,}def test_deprecated_versions_carry_sunset_dates(self):# "v1" backs the sunset 202508 header (see client.API_VERSION); 202606 sunsets 2027-06-15.# The in-product deprecation banner depends on this metadata staying declared, and the default- # (202609) must never appear here.+ # (202610) must never appear here.assert self.source.deprecated_versions == (VersionDeprecation(version="v1", sunset_at=date(2026, 8, 1)),VersionDeprecation(version=LINKEDIN_ADS_VERSION_202606, sunset_at=date(2027, 6, 15)),@@ -119,8 +121,9 @@ class TestLinkedInAdsSource:(LINKEDIN_ADS_VERSION_202607, "202607"),(LINKEDIN_ADS_VERSION_202608, "202608"),(LINKEDIN_ADS_VERSION_202609, "202609"),+ (LINKEDIN_ADS_VERSION_202610, "202610"),# No pin resolves to the new default.- (None, "202609"),+ (None, "202610"),# An undeclared pin is honored verbatim and passed straight through for LinkedIn to validate.("209901", "209901"),],@@ -149,7 +152,7 @@ class TestLinkedInAdsSource:self.source.get_oauth_accounts(integration_id=456, team_id=self.team_id)- assert mock_client_for_integration.call_args.kwargs["api_version"] == "202609"+ assert mock_client_for_integration.call_args.kwargs["api_version"] == "202610"def test_demographic_breakdowns_are_offered_but_not_enabled_by_default(self):# These fan out to one row per day per demographic value on top of the performance tables,