Skip to content

🎉Source Facebook Marketing: use AdAccount('act_{id}') to find account instead of iterating - #11751

Merged
Augustin (alafanechere) merged 8 commits into
airbytehq:masterfrom
mdibaiee:11750-ad-account
Apr 15, 2022
Merged

Augustin (alafanechere) merged 8 commits into
airbytehq:masterfrom
mdibaiee:11750-ad-account

Conversation

@mdibaiee

Copy link
Copy Markdown
Contributor

resolves #11750

What

How

  • Instead of iterating over accounts in the list of AdAccounts, directly initialise an AdAccount with the given ID

Recommended reading order

  1. airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/api.py

🚨 User Impact 🚨

Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.

Pre-merge Checklist

Expand the relevant checklist and delete the others.

Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the new connector version is published, connector version bumped in the seed directory as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

@CLAassistant

CLAassistant commented Apr 6, 2022 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@alafanechere Augustin (alafanechere) changed the title fix: use AdAccount('act_{id}') to find account instead of iterating Source facebook-marketing: use AdAccount('act_{id}') to find account instead of iterating Apr 13, 2022
@alafanechere

Copy link
Copy Markdown
Contributor

Thank you for your contribution Mahdi Dibaiee (@mdibaiee). As this connector has the General Availability status we need our connector team to give a review. I'm going to run the acceptance test first.

@alafanechere

Augustin (alafanechere) commented Apr 13, 2022 •

Copy link
Copy Markdown
Contributor

/test connector=connectors/source-facebook-marketing

🕑 connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/2162548412
❌ connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/2162548412
🐛 https://gradle.com/s/pbsghlj4yb4ws

@alafanechere Augustin (alafanechere) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mahdi Dibaiee (@mdibaiee) could you please update/create the unit tests related to the function you updated?

@github-actions github-actions Bot added the area/documentation Improvements or additions to documentation label Apr 14, 2022
@lazebnyi

Serhii Lazebnyi (lazebnyi) commented Apr 14, 2022 •

Copy link
Copy Markdown
Contributor

/test connector=connectors/source-facebook-marketing

🕑 connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/2166602296
❌ connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/2166602296
🐛 https://gradle.com/s/zehvtqrzwvufu
Python short test summary info:

=========================== short test summary info ============================
FAILED test_core.py::TestConnection::test_check[inputs1] - AssertionError: as...
=================== 1 failed, 21 passed in 609.51s (0:10:09) ===================

@lazebnyi Serhii Lazebnyi (lazebnyi) changed the title Source facebook-marketing: use AdAccount('act_{id}') to find account instead of iterating 🎉Source Facebook Marketing: use AdAccount('act_{id}') to find account instead of iterating Apr 14, 2022
@lazebnyi

Serhii Lazebnyi (lazebnyi) commented Apr 14, 2022 •

Copy link
Copy Markdown
Contributor

/test connector=connectors/source-facebook-marketing

🕑 connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/2167247235
✅ connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/2167247235
Python tests coverage:

Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
source_acceptance_test/utils/__init__.py                 6      0   100%
source_acceptance_test/tests/__init__.py                 4      0   100%
source_acceptance_test/__init__.py                       2      0   100%
source_acceptance_test/tests/test_full_refresh.py       52      2    96%
source_acceptance_test/utils/asserts.py                 37      2    95%
source_acceptance_test/config.py                        74      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/utils/common.py                  70     17    76%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/tests/test_core.py              285    106    63%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
source_acceptance_test/tests/test_incremental.py        69     38    45%
------------------------------------------------------------------------
TOTAL                                                  886    259    71%
Name                                                        Stmts   Miss  Cover
-------------------------------------------------------------------------------
source_facebook_marketing/streams/__init__.py                   2      0   100%
source_facebook_marketing/spec.py                              33      0   100%
source_facebook_marketing/__init__.py                           2      0   100%
source_facebook_marketing/api.py                               96     12    88%
source_facebook_marketing/streams/base_streams.py             127     27    79%
source_facebook_marketing/streams/common.py                    41     13    68%
source_facebook_marketing/streams/streams.py                   97     32    67%
source_facebook_marketing/source.py                            39     16    59%
source_facebook_marketing/streams/base_insight_streams.py     129     54    58%
source_facebook_marketing/streams/async_job.py                204    128    37%
source_facebook_marketing/streams/async_job_manager.py         74     56    24%
-------------------------------------------------------------------------------
TOTAL                                                         844    338    60%
Name                                                        Stmts   Miss  Cover
-------------------------------------------------------------------------------
source_facebook_marketing/streams/async_job.py                204      0   100%
source_facebook_marketing/streams/__init__.py                   2      0   100%
source_facebook_marketing/spec.py                              33      0   100%
source_facebook_marketing/__init__.py                           2      0   100%
source_facebook_marketing/streams/common.py                    41      1    98%
source_facebook_marketing/source.py                            39      1    97%
source_facebook_marketing/streams/async_job_manager.py         74      3    96%
source_facebook_marketing/api.py                               96      9    91%
source_facebook_marketing/streams/base_insight_streams.py     129     13    90%
source_facebook_marketing/streams/streams.py                   97     22    77%
source_facebook_marketing/streams/base_streams.py             127     30    76%
-------------------------------------------------------------------------------
TOTAL                                                         844     79    91%

@lazebnyi

Copy link
Copy Markdown
Contributor

Pls, publish/merge after #11801.

@alafanechere

Augustin (alafanechere) commented Apr 15, 2022 •

Copy link
Copy Markdown
Contributor

/publish connector=connectors/source-facebook-marketing auto-bump-version=false

🕑 connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/2171384483
🚀 Successfully published connectors/source-facebook-marketing
✅ connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/2171384483

@alafanechere Augustin (alafanechere) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for your contribution Mahdi Dibaiee (@mdibaiee)! Ready to merge

@mdibaiee
Mahdi Dibaiee (mdibaiee) deleted the 11750-ad-account branch November 8, 2022 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/connectors Connector related issues area/documentation Improvements or additions to documentation community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Source Facebook Marketing: find_account method does not work on privacy filtered accounts

5 participants