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

✨ TikTok Marketing Source: Add SparkAds Stream #45081

Merged
merged 24 commits into from
Mar 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
491c58a
add spark ads stream
topefolorunso Sep 2, 2024
ce16372
Update tiktok-marketing.md
topefolorunso Sep 2, 2024
fcecba6
Update manifest.yaml
topefolorunso Sep 2, 2024
bc3d834
fix
topefolorunso Sep 2, 2024
2a58d90
Update tiktok-marketing.md
topefolorunso Sep 2, 2024
66fe1ed
fix
topefolorunso Sep 2, 2024
5962aca
Merge branch 'tope/tiktok-marketing/add-sparkAds-stream' of https://g…
topefolorunso Sep 2, 2024
21cf97c
add schema
topefolorunso Sep 18, 2024
e519337
Merge branch 'master' of https://github.com/airbytehq/airbyte into to…
topefolorunso Sep 18, 2024
7ffb51e
lock poetry
topefolorunso Sep 18, 2024
bca1ef8
chore: auto-fix lint and format issues
octavia-squidington-iii Sep 18, 2024
5f7d07f
Merge branch 'master' into tope/tiktok-marketing/add-sparkAds-stream
topefolorunso Sep 21, 2024
c978fd6
Merge branch 'master' into tope/tiktok-marketing/add-sparkAds-stream
topefolorunso Oct 17, 2024
61ebcd0
Merge branch 'master' into tope/tiktok-marketing/add-sparkAds-stream
ChristoGrab Oct 18, 2024
48d2c25
chore: poetry lock
ChristoGrab Oct 18, 2024
3f1fc1c
Merge branch 'master' of https://github.com/airbytehq/airbyte into to…
topefolorunso Mar 7, 2025
dcef104
fix
topefolorunso Mar 7, 2025
91cadc4
Merge branch 'master' of https://github.com/airbytehq/airbyte into to…
topefolorunso Mar 7, 2025
a9e6530
Update pyproject.toml
topefolorunso Mar 7, 2025
762ef12
fix schema, unit test
topefolorunso Mar 7, 2025
28913bd
Merge branch 'master' of https://github.com/airbytehq/airbyte into to…
topefolorunso Mar 7, 2025
6a7cdf8
Merge branch 'tope/tiktok-marketing/add-sparkAds-stream' of https://g…
topefolorunso Mar 7, 2025
3efaaf8
Merge branch 'master' of https://github.com/airbytehq/airbyte into to…
topefolorunso Mar 9, 2025
8a0a9dc
fix
topefolorunso Mar 9, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ acceptance_tests:
bypass_reason: "System music provided by TikTok - very volatile data."
- name: advertisers_audience_reports_lifetime
bypass_reason: "No data in the integration test account. We should seed the sandbox later on."
- name: spark_ads
bypass_reason: "No data in the integration test account. We should seed the sandbox later on."
full_refresh:
tests:
- config_path: "secrets/config.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,17 @@
"destination_sync_mode": "overwrite",
"cursor_field": ["stat_time_day"],
"primary_key": [["ad_id"], ["stat_time_day"], ["platform"]]
},
{
"stream": {
"name": "spark_ads",
"json_schema": {},
"supported_sync_modes": ["full_refresh"],
"source_defined_primary_key": [["spark_ads_post_id"]]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
"primary_key": [["spark_ads_post_id"]]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: 4bfac00d-ce15-44ff-95b9-9e3c3e8fbd35
dockerImageTag: 4.4.0
dockerImageTag: 4.5.0
dockerRepository: airbyte/source-tiktok-marketing
documentationUrl: https://docs.airbyte.com/integrations/sources/tiktok-marketing
githubIssueLabel: source-tiktok-marketing
Expand Down
193 changes: 58 additions & 135 deletions airbyte-integrations/connectors/source-tiktok-marketing/poetry.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "4.4.0"
version = "4.5.0"
name = "source-tiktok-marketing"
description = "Source implementation for Tiktok Marketing."
authors = [ "Airbyte <contact@airbyte.io>",]
Expand All @@ -24,10 +24,10 @@ freezegun = "^1.1.0"
source-tiktok-marketing = "source_tiktok_marketing.run:run"

[tool.poetry.group.dev.dependencies]
requests-mock = "==1.12.1"
requests-mock = "*"
timeout-decorator = "==0.5.0"
pytest-mock = "^3.6.1"
pytest = "^8.0.0"
pytest-mock = "*"
pytest = "*"


[tool.poe]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1626,6 +1626,47 @@ definitions:
- type: CustomTransformation
class_name: "source_tiktok_marketing.components.transformations.TransformEmptyMetrics"

spark_ads_stream:
type: DeclarativeStream
name: spark_ads
primary_key:
- spark_ads_post_id
retriever:
type: SimpleRetriever
requester:
$ref: "#/definitions/requester"
path: tt_video/list/
record_selector:
$ref: "#/definitions/record_selector"
paginator:
$ref: "#/definitions/paginator_page_increment"
pagination_strategy:
type: "PageIncrement"
page_size: 50
start_from_page: 1
partition_router:
type: SubstreamPartitionRouter
parent_stream_configs:
- type: ParentStreamConfig
parent_key: advertiser_id
request_option:
type: RequestOption
inject_into: request_parameter
field_name: advertiser_id
partition_field: advertiser_id
stream:
$ref: "#/definitions/advertisers_stream"
transformations:
- type: AddFields
fields:
- path:
- spark_ads_post_id
value: "{{ record['item_info']['item_id'] }}"
schema_loader:
type: InlineSchemaLoader
schema:
$ref: "#/definitions/schemas/spark_ads"

schemas:
advertiser_ids:
$schema: http://json-schema.org/draft-07/schema#
Expand Down Expand Up @@ -4118,6 +4159,155 @@ definitions:
type:
- "null"
- string
spark_ads:
$schema: http://json-schema.org/draft-07/schema#
additionalProperties: true
type: object
properties:
spark_ads_post_id:
type:
- "null"
- string
user_info:
type:
- "null"
- object
properties:
tiktok_name:
type:
- "null"
- string
identity_id:
type:
- "null"
- string
identity_type:
type:
- "null"
- string
item_info:
type:
- "null"
- object
properties:
anchor_list:
type:
- "null"
- array
items:
type:
- "null"
- object
properties:
id:
type:
- "null"
- string
status:
type:
- "null"
- string
product_regions:
type:
- "null"
- array
items:
type:
- "null"
- string
url:
type:
- "null"
- string
title:
type:
- "null"
- string
text:
type:
- "null"
- string
status:
type:
- "null"
- string
auth_code:
type:
- "null"
- string
item_id:
type:
- "null"
- string
item_type:
type:
- "null"
- string
carousel_info:
type:
- "null"
- object
auth_info:
type:
- "null"
- object
properties:
auth_start_time:
type:
- "null"
- string
format: date-time
ad_auth_status:
type:
- "null"
- string
invite_start_time:
type:
- "null"
- string
format: date-time
auth_end_time:
type:
- "null"
- string
format: date-time
video_info:
type:
- "null"
- object
properties:
duration:
type:
- "null"
- number
preview_url:
type:
- "null"
- string
bit_rate:
type:
- "null"
- integer
height:
type:
- "null"
- integer
width:
type:
- "null"
- integer
signature:
type:
- "null"
- string
size:
type:
- "null"
- integer
poster_url:
type:
- "null"
- string

streams:
- $ref: "#/definitions/advertiser_ids_stream"
Expand Down Expand Up @@ -4156,6 +4346,7 @@ streams:
- $ref: "#/definitions/campaigns_reports_lifetime_stream"
- $ref: "#/definitions/ad_groups_reports_lifetime_stream"
- $ref: "#/definitions/advertisers_audience_reports_lifetime_stream"
- $ref: "#/definitions/spark_ads_stream"

spec:
type: Spec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@pytest.mark.parametrize(
"config, stream_len",
[
({"access_token": "token", "environment": {"app_id": "1111", "secret": "secret"}, "start_date": "2021-04-01"}, 36),
({"access_token": "token", "environment": {"app_id": "1111", "secret": "secret"}, "start_date": "2021-04-01"}, 37),
({"access_token": "token", "start_date": "2021-01-01", "environment": {"advertiser_id": "1111"}}, 28),
(
{
Expand All @@ -23,7 +23,7 @@
"start_date": "2021-04-01",
"report_granularity": "LIFETIME",
},
36,
37,
),
(
{
Expand All @@ -32,7 +32,7 @@
"start_date": "2021-04-01",
"report_granularity": "DAY",
},
36,
37,
),
],
)
Expand Down
2 changes: 2 additions & 0 deletions docs/integrations/sources/tiktok-marketing.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ The TikTok Marketing source connector supports the following [sync modes](https:
| CampaignsAudienceReportsDaily | Prod,Sandbox | campaign_id, stat_time_day, gender, age | Yes |
| CampaignsAudienceReportsByCountryDaily | Prod,Sandbox | campaign_id, stat_time_day, country_code | Yes |
| CampaignsAudienceReportsByPlatformDaily | Prod,Sandbox | campaign_id, stat_time_day, platform | Yes |
| SparkAds | Prod | spark_ads_post_id | No |

:::info

Expand All @@ -138,6 +139,7 @@ The connector is restricted by [requests limitation](https://business-api.tiktok

| Version | Date | Pull Request | Subject |
|:----------|:-----------|:---------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 4.5.0 | 2025-03-07 | [45081](https://github.com/airbytehq/airbyte/pull/45081) | Add SparkAds stream |
| 4.4.0 | 2025-03-07 | [55242](https://github.com/airbytehq/airbyte/pull/55242) | Promoting release candidate 4.4.0-rc3 to a main version. |
| 4.4.0-rc3 | 2025-03-04 | [55194](https://github.com/airbytehq/airbyte/pull/55194) | Resolve state format issue |
| 4.4.0-rc2 | 2025-02-20 | [53645)](https://github.com/airbytehq/airbyte/pull/53645) | Remove stream_state interpolation and custom cursors |
Expand Down
Loading