Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Nov 27, 2025

What

Fixes a bug in the pixel_events_statistics stream where pixel_ids was being sent as a string instead of a JSON array, causing the TikTok API to return error code 40002: pixel_ids: Field must be set to array.

Reported in Slack by a customer who was unable to sync the pixel_events_statistics stream.

How

Uses explicit JSON array syntax to ensure pixel_ids is sent as a proper JSON array string in the query parameter.

Before: pixel_ids=7577353199770828808
After: pixel_ids=["7577353199770828808"] (URL-encoded)

The fix uses "[\"{{ stream_partition['pixel_id'] }}\"]" to hard-code the JSON array brackets around the interpolated pixel ID value.

Updates since last revision

  • Changed approach: Initial fix using | tojson Jinja filter did not work in testing (the parameter was still sent as a plain string). Switched to explicit JSON array syntax which should reliably produce the correct format.
  • Version: Bumped to 4.8.11-rc.3

Review guide

  1. airbyte-integrations/connectors/source-tiktok-marketing/manifest.yaml - Single line change using explicit JSON array syntax
  2. airbyte-integrations/connectors/source-tiktok-marketing/metadata.yaml - Version bump to 4.8.11-rc.3
  3. docs/integrations/sources/tiktok-marketing.md - Changelog entry (also fixed a malformed line from a previous merge)

Human review checklist

  • Verify the explicit JSON array syntax "[\"{{ stream_partition['pixel_id'] }}\"]" produces the correct URL-encoded format
  • Important: Test the fix to confirm it resolves the pixel_ids: Field must be set to array error (previous | tojson approach failed in testing)
  • Confirm changelog entry formatting is correct

User Impact

Users syncing the pixel_events_statistics stream will no longer encounter the pixel_ids: Field must be set to array error.

Can this PR be safely reverted and rolled back?

  • YES 💚

Link to Devin run: https://app.devin.ai/sessions/a8d99d2e325f4e03b3354fa63f9a4308
Requested by: Vai Ignatavicius (@vai-airbyte)

…events_statistics stream

Co-Authored-By: Vai Ignatavicius <[email protected]>
@devin-ai-integration
Copy link
Contributor Author

Original prompt from Vai
Received message in Slack channel #ask-devin-ai:

Hey @Devin customer reported an issue with tiktok marketing 4.8.10 connector `pixel_events_statistics` stream.
Error: `Warning from source: pixel_ids: Field must be set to array` 
I was able to reproduce in my workspace. It looks like a bug, the `PixelEventsStatistics` stream (added in version 4.6.0) is sending `pixel_ids` as a string instead of an array.  Please debug.
```'GET' request to '<https://business-api.tiktok.com/open_api/v1.3/pixel/event/stats/?pixel_ids=7577353199770828808&date_range=%7B%22start_date%22%3A2025-12-26%2C%22end_date%22%3A2025-11-27%7D&advertiser_id=7001035076276387841>' failed with status code '200' and error message: 'pixel_ids: Field must be set to array'. Request (body): 'None'. Response (body): '{'code': 40002, 'message': 'pixel_ids: Field must be set to array', 'request_id': '202511271057326B106C56417B466B9F89'}'. Response (headers): '{'Server': 'nginx', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '114', 'x-tt-logid': '202511271057326B106C56417B466B9F89', 'Access-Control-Expose-Headers': 'x-tt-traceflag,x-tt-logid', 'x-tt-trace-host': '011390812949ff98dc73a4338a754ef00d8a7d3fa053ea33162eaee657859ba29bafcf89330b48fc1eb7b235b6e8fb88d8e98b416f1ab2ca9237dcc8c14614b69f9c279dc6dd07a66e6ade9c0b343284e168ccce07361b27d7abf78d1fe82b6fe08495e49efa7727ec348126cbee936a2f', 'x-tt-trace-id': '00-2511271057326B106C56417B466B9F89-1D21D4BECB8C83AD-00', 'X-Origin-Response-Time': '62,23.3.98.145', 'X-Akamai-Request-ID': '156ac957.2d6af442', 'Expires': 'Thu, 27 Nov 2025 10:57:32 GMT', 'Cache-Control': 'max-age=0, no-cache, no-store', 'Pragma': 'no-cache', 'Date': 'Thu, 27 Nov 2025 10:57:32 GMT', 'X-Cache': 'TCP_MISS from <http://a23-33-89-232.deploy.akamaitechnologies.com|a23-33-89-232.deploy.akamaitechnologies.com> (AkamaiGHost/22.3.2.1-992afe98b9405e84f19be223dce3e955) (-)', 'Connection': 'keep-alive', 'X-Cache-Remote': 'TCP_MISS from <http://a23-3-98-145.deploy.akamaitechnologies... (382 chars truncated...)

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Contributor

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

Helpful Resources

PR Slash Commands

Airbyte Maintainers (that's you!) can execute the following slash commands on your PR:

  • /format-fix - Fixes most formatting issues.
  • /bump-version - Bumps connector versions.
    • You can specify a custom changelog by passing changelog. Example: /bump-version changelog="My cool update"
    • Leaving the changelog arg blank will auto-populate the changelog from the PR title.
  • /run-cat-tests - Runs legacy CAT tests (Connector Acceptance Tests)
  • /run-live-tests - Runs live tests for the modified connector(s).
  • /run-regression-tests - Runs regression tests for the modified connector(s).
  • /build-connector-images - Builds and publishes a pre-release docker image for the modified connector(s).
  • /publish-connectors-prerelease - Publishes pre-release connector builds (tagged as {version}-dev.{git-sha}) for all modified connectors in the PR.
  • JVM connectors:
    • /update-connector-cdk-version connector=<CONNECTOR_NAME> - Updates the specified connector to the latest CDK version.
      Example: /update-connector-cdk-version connector=destination-bigquery
    • /bump-bulk-cdk-version bump=patch changelog='foo' - Bump the Bulk CDK's version. bump can be major/minor/patch.
  • Python connectors:
    • /poe connector source-example lock - Run the Poe lock task on the source-example connector, committing the results back to the branch.
    • /poe source example lock - Alias for /poe connector source-example lock.
    • /poe source example use-cdk-branch my/branch - Pin the source-example CDK reference to the branch name specified.
    • /poe source example use-cdk-latest - Update the source-example CDK dependency to the latest available version.

📝 Edit this welcome message.

@vai-airbyte
Copy link
Contributor

vai-airbyte commented Nov 27, 2025

/bump-version

Bump Version job started... Check job output.

🔴 Job completed successfully (no changes, this is sus).

@airbytehq airbytehq deleted a comment from devin-ai-integration bot Nov 27, 2025
devin-ai-integration bot and others added 2 commits November 27, 2025 11:17
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Nov 27, 2025

Deploy preview for airbyte-docs ready!

✅ Preview
https://airbyte-docs-6el59r9fn-airbyte-growth.vercel.app

Built with commit 6fc74ac.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link
Contributor

source-tiktok-marketing Connector Test Results

46 tests   39 ✅  1m 1s ⏱️
 2 suites   7 💤
 2 files     0 ❌

Results for commit 6fc74ac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants