Skip to content

Conversation

@dbgold17
Copy link
Contributor

@dbgold17 dbgold17 commented Oct 23, 2025

What

Upgrades the source-facebook-marketing connector to support Python 3.13 and bumps the version to 4.2.0. This addresses the need to modernize the connector's Python runtime support.

Related to session: https://app.devin.ai/sessions/8746815748ba4a248da87379be2700dd
Requested by: David Gold (@dbgold17)

How

  1. Updated Python constraint in pyproject.toml from ^3.10,<3.12 to >=3.10,<3.14
    • The upper bound of <3.14 is required because airbyte-cdk currently only supports up to Python 3.13
  2. Regenerated poetry.lock with the new Python constraint
  3. Updated base image in metadata.yaml to python-connector-base:4.1.0 (includes Python 3.13 support)
  4. Bumped version from 4.1.0 to 4.2.0 as a minor version increment
  5. Added changelog entry in the documentation

Review guide

  1. airbyte-integrations/connectors/source-facebook-marketing/pyproject.toml - Review Python constraint change (line 19)
  2. airbyte-integrations/connectors/source-facebook-marketing/metadata.yaml - Verify base image update (line 9) and version bump (line 13)
  3. docs/integrations/sources/facebook-marketing.md - Check changelog entry format and placement (line 359)
  4. PYTHON_313_UPGRADE.md - Documentation of upgrade process (informational)
  5. Most important: Verify that CI checks pass, especially the Docker image build

User Impact

  • Connector will now support Python 3.13 runtime
  • No functional changes to connector behavior
  • Users on older Python versions (3.10, 3.11, 3.12) are unaffected

⚠️ Known Issue: Local Docker image build fails due to numpy requiring C compiler. Unit tests (262 tests) passed successfully with Python 3.13, but image smoke test could not complete locally. This assumes CI has proper build tools configured.

Can this PR be safely reverted and rolled back?

  • YES 💚

This is a dependency update with no functional changes. Reverting would restore Python 3.10-3.11 support only.

- Update Python version constraint from ^3.10,<3.12 to >=3.10,<3.14
- Update base image to python-connector-base:4.1.0 (Python 3.13)
- Regenerate poetry.lock for Python 3.13 compatibility
- All 262 unit tests pass successfully
- Add detailed upgrade documentation in PYTHON_313_UPGRADE.md

Co-Authored-By: David Gold <32782137+dbgold17@users.noreply.github.com>
@devin-ai-integration
Copy link
Contributor

Original prompt from David Gold
I’d like you to help me upgrade source-facebook-marketing to use python 3.13.9. The connector’s code and python project information (including dependencies) can be found in airbyte-integration/connectors/<connector-name>. Using Python 3.13.9 in a local environment, please attempt to unpin the Python version constraint in pyproject.toml and then proceed to install requirements. If a dependency conflict exists, please make a note of that, and then proceed to try to upgrade that dependency so that the conflict is resolved. Continue iteratively doing this process until you are able to install all of the requirements or else report the reason why that could not be done. As you go through this process list out the steps you took to incrementally upgrade dependencies and why you took that step. Save this as a file that I can review afterwards



Once you’re able to install the connector with Python 3.13.9, please verify the connector still works by running unit and integration tests (poe test-unit-tests and poe-test-integration-tests). 


Once that is complete, update the connector’s base image to a version that uses Python 3.13. I’ve created such a base image already, here is the reference: docker.io/airbyte/python-connector-base:4.1.0@sha256:1d1aa21d34e851df4e8a87b391c27724c06e2597608e7161f4d167be853bd7b6



Finally run an image smoke test with `airbyte-cdk image test`. Please report back the results from all of these tests. If they fail, feel free to investigate the cause and report that back as well. 



Regardless, go ahead an open a PR with the changes you’ve made and tag me @dbgold17 as a reviewer

@devin-ai-integration
Copy link
Contributor

🤖 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)
  • /build-connector-images - Builds and publishes a pre-release docker image for the modified connector(s).
  • 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 type=patch changelog='foo' - Bump the Bulk CDK's version. type 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.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

source-facebook-marketing Connector Test Results

269 tests   265 ✅  14s ⏱️
  2 suites    4 💤
  2 files      0 ❌

Results for commit 3365d0e.

♻️ This comment has been updated with latest results.

Co-Authored-By: David Gold <32782137+dbgold17@users.noreply.github.com>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

markdownlint

[markdownlint] reported by reviewdog 🐶
MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```diff"]


[markdownlint] reported by reviewdog 🐶
MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### 2. metadata.yaml"]


[markdownlint] reported by reviewdog 🐶
MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```diff"]


[markdownlint] reported by reviewdog 🐶
MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### 3. poetry.lock"]


[markdownlint] reported by reviewdog 🐶
MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "- Regenerated with Python 3.13..."]


[markdownlint] reported by reviewdog 🐶
MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Conclusion"]


[markdownlint] reported by reviewdog 🐶
MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "- ✅ Installs successfully with..."]

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

Deploy preview for airbyte-docs ready!

✅ Preview
https://airbyte-docs-74glh7f1d-airbyte-growth.vercel.app

Built with commit 3365d0e.
This pull request is being automatically deployed with vercel-action

python = "^3.10,<3.14"
airbyte-cdk = "^7"
facebook-business = "^23.0.0"
facebook-business = "23.0.1"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I pinned the exact version of the facebook business API because it seems that new version add in new ads insights breakdowns and I figured we'd want to control that given the unit tests we have.

If I unpin it, unit tests need to be updated since we apparently compare the list of ads insights from their API with a static list we have locally. If we feel comfortable unpinning, it isn't clear what value that unit test is adding and I can remove it.

Copy link
Contributor

Choose a reason for hiding this comment

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

ads breakdowns have very specific setups and i think can actually lead to missing records and other painful bugs. I would recommend we err on the side of keeping these types of tests if we're not sure their use because it was probably there for a reason in a previous painful OC issue

How many tests break from this out of curiosity. I'm fine with a pin just so we don't combine too many changes into a single release. But 2 points of due diligence we should note:

  • When does v23 deprecate? how much time do we have before it does. If its soon we need to prioritize
  • If there is no version upgrade GH issue, we should create it. If it already exists, then can you add a note about the impact to the unit tests and that you pinned it here during the 3.13 upgrade

Copy link
Contributor Author

Choose a reason for hiding this comment

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

v24 of the API seems like it was just released (v24 of the Python library doesn't exist yet) and so we have some time. I added a note to this issue

A nice side effect of pinning the patch version of this package is that the up-to-date pipeline will be more likely to succeed in updating other dependencies automatically.

@dbgold17 dbgold17 changed the title chore(source-facebook-marketing): Upgrade to Python 3.13 support chore(source-facebook-marketing): Upgrade to Python 3.13 Oct 24, 2025
Copy link
Contributor

@brianjlai brianjlai left a comment

Choose a reason for hiding this comment

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

similar to salesforce, have we run some regression tests on this?

pending that, but not going to block on approval

python = "^3.10,<3.14"
airbyte-cdk = "^7"
facebook-business = "^23.0.0"
facebook-business = "23.0.1"
Copy link
Contributor

Choose a reason for hiding this comment

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

ads breakdowns have very specific setups and i think can actually lead to missing records and other painful bugs. I would recommend we err on the side of keeping these types of tests if we're not sure their use because it was probably there for a reason in a previous painful OC issue

How many tests break from this out of curiosity. I'm fine with a pin just so we don't combine too many changes into a single release. But 2 points of due diligence we should note:

  • When does v23 deprecate? how much time do we have before it does. If its soon we need to prioritize
  • If there is no version upgrade GH issue, we should create it. If it already exists, then can you add a note about the impact to the unit tests and that you pinned it here during the 3.13 upgrade

@devin-ai-integration
Copy link
Contributor

@dbgold17 pinned the facebook-business version to 23.0.1 to prevent the test_all_breakdowns_have_schemas test from failing when new breakdowns are added in newer versions of the facebook-business library.

The test at line 768 in unit_tests/test_base_insight_streams.py validates that all breakdowns from the Facebook API (ValidBreakdowns enum, which is derived from AdsInsights.Breakdowns in the facebook-business library) have corresponding schema definitions in ads_insights_breakdowns.json. When the facebook-business library adds new breakdowns, this test would fail unless the schema file is updated to include definitions for those new breakdowns.

Regarding your questions:

  • How many tests break: Just the one test (test_all_breakdowns_have_schemas) would fail if new breakdowns are added in a newer facebook-business version
  • v23 deprecation timeline: I'll defer to @dbgold17 to check the Facebook Marketing API deprecation schedule
  • Version upgrade issue: I'll also defer to @dbgold17 to create or link to a GitHub issue for tracking the facebook-business version upgrade

The pin makes sense for this PR to keep the scope focused on the Python 3.13 upgrade without introducing additional changes from a facebook-business library update.

@dbgold17
Copy link
Contributor Author

regression test run: https://github.com/airbytehq/airbyte/actions/runs/18793289999

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