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

Source: Facebook Marketing - New default for action_breakdowns, improve "check" speed #19803

Merged
merged 11 commits into from
Nov 28, 2022

Conversation

grubberr
Copy link
Contributor

@grubberr grubberr commented Nov 25, 2022

Signed-off-by: Sergey Chvalyuk grubberr@gmail.com

What

Try to improve oncall https://github.com/airbytehq/oncall/issues/1083
Make new default for action_breakdowns: ["action_type", "action_target_id", "action_destination"]

Also improve "check" command, it can be very slow after this PR #19645
I am trying to improve this

How

Describe the solution

Recommended reading order

  1. x.java
  2. y.python

🚨 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 and connector version bumped by running the /publish command described here

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
@grubberr
Copy link
Contributor Author

grubberr commented Nov 25, 2022

/test connector=connectors/source-facebook-marketing

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

Build Failed

Test summary info:

Could not find result summary

@grubberr grubberr changed the title Source: Facebook Marketing - improve defaults for action_breakdowns Source: Facebook Marketing - New default for action_breakdowns, improve "check" speed after PR #19645 Nov 25, 2022
@grubberr grubberr changed the title Source: Facebook Marketing - New default for action_breakdowns, improve "check" speed after PR #19645 Source: Facebook Marketing - New default for action_breakdowns, improve "check" speed Nov 25, 2022
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
@octavia-squidington-iv octavia-squidington-iv added the area/documentation Improvements or additions to documentation label Nov 25, 2022
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
@grubberr
Copy link
Contributor Author

grubberr commented Nov 25, 2022

/test connector=connectors/source-facebook-marketing

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

Build Failed

Test summary info:

=========================== short test summary info ============================
FAILED test_core.py::TestSpec::test_match_expected[inputs0] - AssertionError:...
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_incremental.py:200: Skipping new incremental test based on acceptance-test-config.yml
======= 1 failed, 29 passed, 1 skipped, 31 warnings in 968.39s (0:16:08) =======

> Task :airbyte-integrations:connectors:source-facebook-marketing:sourceAcceptanceTest FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings

Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
50 actionable tasks: 37 executed, 13 up-to-date

Publishing build scan...
https://gradle.com/s/oycn5mr5f27ke

The remote build cache was disabled during the build due to errors.
S3 cache 652ms wasted on misses, reads: 1, elapsed: 652ms
S3 cache writes: 1, elapsed: 64ms, sent to cache: 90 KiB

Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
@grubberr
Copy link
Contributor Author

grubberr commented Nov 25, 2022

/test connector=connectors/source-facebook-marketing

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

Build Failed

Test summary info:

=========================== short test summary info ============================
FAILED test_full_refresh.py::TestFullRefresh::test_sequential_reads[inputs0]
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_incremental.py:200: Skipping new incremental test based on acceptance-test-config.yml
======= 1 failed, 29 passed, 1 skipped, 31 warnings in 860.09s (0:14:20) =======

> Task :airbyte-integrations:connectors:source-facebook-marketing:sourceAcceptanceTest FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings

Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
50 actionable tasks: 37 executed, 13 up-to-date

Publishing build scan...
https://gradle.com/s/2sqe6xulcsyxg

The remote build cache was disabled during the build due to errors.
S3 cache 609ms wasted on misses, reads: 1, elapsed: 609ms
S3 cache writes: 1, elapsed: 47ms, sent to cache: 90 KiB

@grubberr
Copy link
Contributor Author

grubberr commented Nov 25, 2022

/test connector=connectors/source-facebook-marketing

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

Build Failed

Test summary info:

=========================== short test summary info ============================
FAILED test_full_refresh.py::TestFullRefresh::test_sequential_reads[inputs0]
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_incremental.py:200: Skipping new incremental test based on acceptance-test-config.yml
======= 1 failed, 29 passed, 1 skipped, 31 warnings in 957.91s (0:15:57) =======

> Task :airbyte-integrations:connectors:source-facebook-marketing:sourceAcceptanceTest FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings

Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
50 actionable tasks: 37 executed, 13 up-to-date

Publishing build scan...
https://gradle.com/s/ujgjjqroez3vi

The remote build cache was disabled during the build due to errors.
S3 cache 511ms wasted on misses, reads: 1, elapsed: 511ms
S3 cache writes: 1, elapsed: 58ms, sent to cache: 90 KiB

@grubberr
Copy link
Contributor Author

grubberr commented Nov 25, 2022

/test connector=connectors/source-facebook-marketing

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

Name                                                        Stmts   Miss  Cover
-------------------------------------------------------------------------------
source_facebook_marketing/streams/__init__.py                   2      0   100%
source_facebook_marketing/__init__.py                           2      0   100%
source_facebook_marketing/spec.py                              40      1    98%
source_facebook_marketing/api.py                               96     12    88%
source_facebook_marketing/streams/base_streams.py             138     27    80%
source_facebook_marketing/source.py                            52     18    65%
source_facebook_marketing/streams/common.py                    44     16    64%
source_facebook_marketing/utils.py                             24      9    62%
source_facebook_marketing/streams/streams.py                  118     45    62%
source_facebook_marketing/streams/base_insight_streams.py     141     60    57%
source_facebook_marketing/streams/async_job.py                217    136    37%
source_facebook_marketing/streams/async_job_manager.py         78     60    23%
-------------------------------------------------------------------------------
TOTAL                                                         952    384    60%
Name                                                        Stmts   Miss  Cover
-------------------------------------------------------------------------------
source_facebook_marketing/utils.py                             24      0   100%
source_facebook_marketing/streams/common.py                    44      0   100%
source_facebook_marketing/streams/async_job.py                217      0   100%
source_facebook_marketing/streams/__init__.py                   2      0   100%
source_facebook_marketing/spec.py                              40      0   100%
source_facebook_marketing/__init__.py                           2      0   100%
source_facebook_marketing/streams/async_job_manager.py         78      3    96%
source_facebook_marketing/api.py                               96      9    91%
source_facebook_marketing/source.py                            52      5    90%
source_facebook_marketing/streams/base_insight_streams.py     141     17    88%
source_facebook_marketing/streams/base_streams.py             138     30    78%
source_facebook_marketing/streams/streams.py                  118     27    77%
-------------------------------------------------------------------------------
TOTAL                                                         952     91    90%
	 Name                                                 Stmts   Miss  Cover   Missing
	 ----------------------------------------------------------------------------------
	 source_acceptance_test/base.py                          12      4    67%   16-19
	 source_acceptance_test/config.py                       139      5    96%   87, 93, 235, 239-240
	 source_acceptance_test/conftest.py                     196     92    53%   35, 41-43, 48, 54, 60, 66, 72-74, 93, 98-100, 106-108, 114-115, 120-121, 126, 132, 141-150, 156-161, 176, 200, 231, 237, 243-248, 256-261, 269-282, 287-293, 300-311, 318-334
	 source_acceptance_test/plugin.py                        69     25    64%   22-23, 31, 36, 120-140, 144-148
	 source_acceptance_test/tests/test_core.py              398    111    72%   53, 58, 87-95, 100-107, 111-112, 116-117, 299, 337-354, 363-371, 375-380, 386, 419-424, 462-469, 512-514, 517, 582-590, 602-605, 610, 666-667, 673, 676, 712-722, 735-760
	 source_acceptance_test/tests/test_incremental.py       158     14    91%   52-59, 64-77, 240
	 source_acceptance_test/utils/asserts.py                 37      2    95%   57-58
	 source_acceptance_test/utils/common.py                  94     10    89%   16-17, 32-38, 72, 75
	 source_acceptance_test/utils/compare.py                 62     23    63%   21-51, 68, 97-99
	 source_acceptance_test/utils/connector_runner.py       112     50    55%   23-26, 32, 36, 39-68, 71-73, 76-78, 81-83, 86-88, 91-93, 96-114, 148-150
	 source_acceptance_test/utils/json_schema_helper.py     107     13    88%   30-31, 38, 41, 65-68, 96, 120, 192-194
	 ----------------------------------------------------------------------------------
	 TOTAL                                                 1563    349    78%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_incremental.py:200: Skipping new incremental test based on acceptance-test-config.yml
============ 30 passed, 1 skipped, 31 warnings in 821.57s (0:13:41) ============

Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
@grubberr
Copy link
Contributor Author

grubberr commented Nov 26, 2022

/test connector=connectors/source-facebook-marketing

🕑 connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/3552833329
❌ connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/3552833329
🐛

Build Failed

Test summary info:

Could not find result summary

@grubberr
Copy link
Contributor Author

grubberr commented Nov 26, 2022

/test connector=connectors/source-facebook-marketing

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

Name                                                        Stmts   Miss  Cover
-------------------------------------------------------------------------------
source_facebook_marketing/streams/__init__.py                   2      0   100%
source_facebook_marketing/__init__.py                           2      0   100%
source_facebook_marketing/spec.py                              40      1    98%
source_facebook_marketing/api.py                               96     12    88%
source_facebook_marketing/streams/base_streams.py             138     27    80%
source_facebook_marketing/source.py                            52     18    65%
source_facebook_marketing/streams/common.py                    44     16    64%
source_facebook_marketing/utils.py                             24      9    62%
source_facebook_marketing/streams/streams.py                  118     45    62%
source_facebook_marketing/streams/base_insight_streams.py     138     61    56%
source_facebook_marketing/streams/async_job.py                217    136    37%
source_facebook_marketing/streams/async_job_manager.py         78     60    23%
-------------------------------------------------------------------------------
TOTAL                                                         949    385    59%
Name                                                        Stmts   Miss  Cover
-------------------------------------------------------------------------------
source_facebook_marketing/utils.py                             24      0   100%
source_facebook_marketing/streams/common.py                    44      0   100%
source_facebook_marketing/streams/async_job.py                217      0   100%
source_facebook_marketing/streams/__init__.py                   2      0   100%
source_facebook_marketing/spec.py                              40      0   100%
source_facebook_marketing/__init__.py                           2      0   100%
source_facebook_marketing/streams/async_job_manager.py         78      3    96%
source_facebook_marketing/api.py                               96      9    91%
source_facebook_marketing/source.py                            52      5    90%
source_facebook_marketing/streams/base_insight_streams.py     138     16    88%
source_facebook_marketing/streams/base_streams.py             138     30    78%
source_facebook_marketing/streams/streams.py                  118     27    77%
-------------------------------------------------------------------------------
TOTAL                                                         949     90    91%
	 Name                                                 Stmts   Miss  Cover   Missing
	 ----------------------------------------------------------------------------------
	 source_acceptance_test/base.py                          12      4    67%   16-19
	 source_acceptance_test/config.py                       139      5    96%   87, 93, 235, 239-240
	 source_acceptance_test/conftest.py                     196     92    53%   35, 41-43, 48, 54, 60, 66, 72-74, 93, 98-100, 106-108, 114-115, 120-121, 126, 132, 141-150, 156-161, 176, 200, 231, 237, 243-248, 256-261, 269-282, 287-293, 300-311, 318-334
	 source_acceptance_test/plugin.py                        69     25    64%   22-23, 31, 36, 120-140, 144-148
	 source_acceptance_test/tests/test_core.py              398    111    72%   53, 58, 87-95, 100-107, 111-112, 116-117, 299, 337-354, 363-371, 375-380, 386, 419-424, 462-469, 512-514, 517, 582-590, 602-605, 610, 666-667, 673, 676, 712-722, 735-760
	 source_acceptance_test/tests/test_incremental.py       158     14    91%   52-59, 64-77, 240
	 source_acceptance_test/utils/asserts.py                 37      2    95%   57-58
	 source_acceptance_test/utils/common.py                  94     10    89%   16-17, 32-38, 72, 75
	 source_acceptance_test/utils/compare.py                 62     23    63%   21-51, 68, 97-99
	 source_acceptance_test/utils/connector_runner.py       112     50    55%   23-26, 32, 36, 39-68, 71-73, 76-78, 81-83, 86-88, 91-93, 96-114, 148-150
	 source_acceptance_test/utils/json_schema_helper.py     107     13    88%   30-31, 38, 41, 65-68, 96, 120, 192-194
	 ----------------------------------------------------------------------------------
	 TOTAL                                                 1563    349    78%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_incremental.py:200: Skipping new incremental test based on acceptance-test-config.yml
============ 30 passed, 1 skipped, 31 warnings in 600.27s (0:10:00) ============

@grubberr
Copy link
Contributor Author

grubberr commented Nov 28, 2022

/test connector=connectors/source-facebook-marketing

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

Name                                                        Stmts   Miss  Cover
-------------------------------------------------------------------------------
source_facebook_marketing/streams/__init__.py                   2      0   100%
source_facebook_marketing/__init__.py                           2      0   100%
source_facebook_marketing/spec.py                              40      1    98%
source_facebook_marketing/api.py                               96     12    88%
source_facebook_marketing/streams/base_streams.py             138     27    80%
source_facebook_marketing/source.py                            52     18    65%
source_facebook_marketing/streams/common.py                    44     16    64%
source_facebook_marketing/utils.py                             24      9    62%
source_facebook_marketing/streams/streams.py                  118     45    62%
source_facebook_marketing/streams/base_insight_streams.py     138     61    56%
source_facebook_marketing/streams/async_job.py                217    136    37%
source_facebook_marketing/streams/async_job_manager.py         78     60    23%
-------------------------------------------------------------------------------
TOTAL                                                         949    385    59%
Name                                                        Stmts   Miss  Cover
-------------------------------------------------------------------------------
source_facebook_marketing/utils.py                             24      0   100%
source_facebook_marketing/streams/common.py                    44      0   100%
source_facebook_marketing/streams/async_job.py                217      0   100%
source_facebook_marketing/streams/__init__.py                   2      0   100%
source_facebook_marketing/spec.py                              40      0   100%
source_facebook_marketing/__init__.py                           2      0   100%
source_facebook_marketing/streams/async_job_manager.py         78      3    96%
source_facebook_marketing/api.py                               96      9    91%
source_facebook_marketing/source.py                            52      5    90%
source_facebook_marketing/streams/base_insight_streams.py     138     16    88%
source_facebook_marketing/streams/base_streams.py             138     30    78%
source_facebook_marketing/streams/streams.py                  118     27    77%
-------------------------------------------------------------------------------
TOTAL                                                         949     90    91%
	 Name                                                 Stmts   Miss  Cover   Missing
	 ----------------------------------------------------------------------------------
	 source_acceptance_test/base.py                          12      4    67%   16-19
	 source_acceptance_test/config.py                       139      5    96%   87, 93, 235, 239-240
	 source_acceptance_test/conftest.py                     196     92    53%   35, 41-43, 48, 54, 60, 66, 72-74, 93, 98-100, 106-108, 114-115, 120-121, 126, 132, 141-150, 156-161, 176, 200, 231, 237, 243-248, 256-261, 269-282, 287-293, 300-311, 318-334
	 source_acceptance_test/plugin.py                        69     25    64%   22-23, 31, 36, 120-140, 144-148
	 source_acceptance_test/tests/test_core.py              398    111    72%   53, 58, 87-95, 100-107, 111-112, 116-117, 299, 337-354, 363-371, 375-380, 386, 419-424, 462-469, 512-514, 517, 582-590, 602-605, 610, 666-667, 673, 676, 712-722, 735-760
	 source_acceptance_test/tests/test_incremental.py       158     14    91%   52-59, 64-77, 240
	 source_acceptance_test/utils/asserts.py                 37      2    95%   57-58
	 source_acceptance_test/utils/common.py                  94     10    89%   16-17, 32-38, 72, 75
	 source_acceptance_test/utils/compare.py                 62     23    63%   21-51, 68, 97-99
	 source_acceptance_test/utils/connector_runner.py       112     50    55%   23-26, 32, 36, 39-68, 71-73, 76-78, 81-83, 86-88, 91-93, 96-114, 148-150
	 source_acceptance_test/utils/json_schema_helper.py     107     13    88%   30-31, 38, 41, 65-68, 96, 120, 192-194
	 ----------------------------------------------------------------------------------
	 TOTAL                                                 1563    349    78%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_incremental.py:200: Skipping new incremental test based on acceptance-test-config.yml
============ 30 passed, 1 skipped, 31 warnings in 588.78s (0:09:48) ============

@grubberr
Copy link
Contributor Author

grubberr commented Nov 28, 2022

/publish connector=connectors/source-facebook-marketing

🕑 Publishing the following connectors:
connectors/source-facebook-marketing
https://github.com/airbytehq/airbyte/actions/runs/3567328106


Connector Did it publish? Were definitions generated?
connectors/source-facebook-marketing

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@grubberr grubberr merged commit e38bd5d into master Nov 28, 2022
@grubberr grubberr deleted the grubberr/oncall-1083-source-facebook-marketing branch November 28, 2022 18:25
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets November 28, 2022 18:25 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets November 28, 2022 18:26 Inactive
@@ -70,8 +67,8 @@ def __init__(
self._start_date = self._start_date.date()
self._end_date = self._end_date.date()
self._fields = fields
self.action_breakdowns = action_breakdowns or self.action_breakdowns
self.breakdowns = breakdowns or self.breakdowns
self.action_breakdowns = action_breakdowns or self.ALL_ACTION_BREAKDOWNS
Copy link
Contributor

Choose a reason for hiding this comment

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

should this also be cleared? (set to [])

This comment seems to imply that it's still an issue https://github.com/airbytehq/oncall/issues/1083#issuecomment-1329630450

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pedroslopez

The main problem here is backward compatibility.
I cannot change action_breakdowns = []
because it will break about 20 existing syncs on the prod cloud.

We need to find a good way to distinguish old created sync from new ones for such cases.

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 connectors/source/facebook-marketing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants