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 - Update CDK to v0.1.58 avoid crashing on incorrect stream schemas #13008

Merged
merged 3 commits into from
May 19, 2022

Conversation

grubberr
Copy link
Contributor

@grubberr grubberr commented May 19, 2022

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

What

Try to avoid such exceptions

2022-05-10 12:12:58 �[44msource�[0m > Syncing stream: ad_account 
2022-05-10 12:12:58 �[44msource�[0m > Encountered an exception while reading stream ad_account
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 114, in read
    yield from self._read_stream(
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 159, in _read_stream
    for record in record_iterator:
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 249, in _read_full_refresh
    yield self._as_airbyte_record(configured_stream.stream.name, record)
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 281, in _as_airbyte_record
    transformer.transform(data, schema)  # type: ignore
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/utils/transform.py", line 172, in transform
    for e in normalizer.iter_errors(record):
  File "/usr/local/lib/python3.9/site-packages/jsonschema/validators.py", line 328, in iter_errors
    for error in errors:
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/utils/transform.py", line 152, in normalizator
    instance[k] = self.__normalize(instance[k], subschema)
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/utils/transform.py", line 79, in __normalize
    original_item = self.default_convert(original_item, subschema)
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/utils/transform.py", line 110, in default_convert
    return float(original_item)
TypeError: float() argument must be a string or a number, not 'list'
2022-05-10 12:12:58 �[44msource�[0m > Finished syncing ad_account
2022-05-10 12:12:58 �[44msource�[0m > SourceFacebookMarketing runtimes:
Syncing stream activities 0:00:08.161673
Syncing stream ad_account 0:00:00.237113
2022-05-10 12:12:58 �[44msource�[0m > float() argument must be a string or a number, not 'list'
Traceback (most recent call last):

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>
@github-actions github-actions bot added area/connectors Connector related issues area/documentation Improvements or additions to documentation labels May 19, 2022
Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
@grubberr
Copy link
Contributor Author

grubberr commented May 19, 2022

/test connector=connectors/source-facebook-marketing

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

=========================== short test summary info ============================
FAILED test_full_refresh.py::TestFullRefresh::test_sequential_reads[inputs0]
================== 1 failed, 23 passed in 1260.68s (0:21:00) ===================

@grubberr grubberr changed the title Source Facebook Marketing - update CDK to v0.1.58 to not crash on incorrect stream schemas Source Facebook Marketing - Update CDK to v0.1.58 avoid crashing on incorrect stream schemas May 19, 2022
@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

❗ No coverage uploaded for pull request base (master@9a960c4). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 1dd4204 differs from pull request most recent head 4bf3e70. Consider uploading reports for the commit 4bf3e70 to get more accurate results

@@            Coverage Diff            @@
##             master   #13008   +/-   ##
=========================================
  Coverage          ?   90.76%           
=========================================
  Files             ?       11           
  Lines             ?      855           
  Branches          ?        0           
=========================================
  Hits              ?      776           
  Misses            ?       79           
  Partials          ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a960c4...4bf3e70. Read the comment docs.

@grubberr
Copy link
Contributor Author

grubberr commented May 19, 2022

/test connector=connectors/source-facebook-marketing

🕑 connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/2350139895
✅ connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/2350139895
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                        77      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/tests/test_incremental.py       121     25    79%
source_acceptance_test/utils/common.py                  80     17    79%
source_acceptance_test/tests/test_core.py              294    106    64%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
------------------------------------------------------------------------
TOTAL                                                  960    246    74%
Name                                                        Stmts   Miss  Cover
-------------------------------------------------------------------------------
source_facebook_marketing/streams/__init__.py                   2      0   100%
source_facebook_marketing/spec.py                              34      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                210    134    36%
source_facebook_marketing/streams/async_job_manager.py         78     60    23%
-------------------------------------------------------------------------------
TOTAL                                                         855    348    59%
Name                                                        Stmts   Miss  Cover
-------------------------------------------------------------------------------
source_facebook_marketing/streams/async_job.py                210      0   100%
source_facebook_marketing/streams/__init__.py                   2      0   100%
source_facebook_marketing/spec.py                              34      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         78      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                                                         855     79    91%

@annalvova05 annalvova05 self-requested a review May 19, 2022 07:35
@grubberr grubberr requested a review from annalvova05 May 19, 2022 07:36
@grubberr
Copy link
Contributor Author

grubberr commented May 19, 2022

/publish connector=connectors/source-facebook-marketing run-tests=false

🕑 connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/2350453367
🚀 Successfully published connectors/source-facebook-marketing
🚀 Auto-bumped version for connectors/source-facebook-marketing
✅ connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/2350453367

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets May 19, 2022 07:52 Inactive
@grubberr grubberr merged commit 735b51b into master May 19, 2022
@grubberr grubberr deleted the grubberr/oncall-232-source-facebook-marketing branch May 19, 2022 07:52
@grubberr grubberr self-assigned this May 19, 2022
suhomud pushed a commit that referenced this pull request May 23, 2022
…ncorrect stream schemas (#13008)

Signed-off-by: Sergey Chvalyuk <grubberr@gmail.com>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants