Skip to content

Conversation

@artusiep
Copy link
Contributor

@artusiep artusiep commented Feb 25, 2023

What

Adding missing metrics for pinterest source

Not all columns are available for synchronous endpoint so I have added all available columns:

- ADVERTISER_ID | #21326 - CLICKTHROUGH_1 | #22206 and #21326 - CLICKTHROUGH_1_GROSS | #21326 - CLICKTHROUGH_2 | #22206 and #21326 - ENGAGEMENT_1 | #22206 and #21326 - ENGAGEMENT_2 | #22206 and #21326 - PIN_ID | #21326 - PIN_PROMOTION_ID | #21326 - REPIN_1 | #21326 - REPIN_2 | #21326 - TOTAL_CLICK_ADD_TO_CART | #22206 and #21326 - TOTAL_CLICK_LEAD | #21326 - TOTAL_CUSTOM | #21326 - TOTAL_ENGAGEMENT | #21326 - TOTAL_ENGAGEMENT_LEAD | #21326 - TOTAL_LEAD | #21326 - TOTAL_OFFLINE_CHECKOUT | #21326 - TOTAL_VIEW_ADD_TO_CART | #21326 - TOTAL_VIEW_LEAD | #21326 - TOTAL_WEB_SESSIONS | #21326 - VIDEO_LENGTH | #21326 - WEB_SESSIONS_1 | #21326 - WEB_SESSIONS_2 | #21326 - VIDEO_P0_COMBINED_1 | Not Available in Synchronous API call - VIDEO_P100_COMPLETE_1 | Not Available in Synchronous API call - VIDEO_P25_COMBINED_1 | Not Available in Synchronous API call - VIDEO_P50_COMBINED_1 | Not Available in Synchronous API call - VIDEO_P75_COMBINED_1 | Not Available in Synchronous API call - VIDEO_P95_COMBINED_1 | Not Available in Synchronous API call - VIDEO_3SEC_VIEWS_1 | Not Available in Synchronous API call - VIDEO_MRC_VIEWS_1 | Not Available in Synchronous API call - APP_INSTALL_COST_PER_ACTION | Not Available in Synchronous API call 

This contribution brings 22 columns to analytics columns.

windows_in_days parameter is not used anywhere, and it is not configurable so deleting that from conftest.

Unit test:
image

Closes #22206 #21326
Duplicates: [https://github.com//pull/22501]

How

Adding columns and making list of columns easier to review

Recommended reading order

  1. airbyte-integrations/connectors/source-pinterest/source_pinterest/utils.py
  2. airbyte-integrations/connectors/source-pinterest/source_pinterest/source.py

🚨 User Impact 🚨

Pinterest source users would need to refresh source schema to pickup changes

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
@artusiep
Copy link
Contributor Author

@artusiep
Copy link
Contributor Author

Acceptance tests:
image

I do not really know how to make this change backward compatibile

@artusiep artusiep changed the title Adding missing metrics for pinterest source Adding missing columns for analytics streams for pinterest source Feb 25, 2023
@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Feb 25, 2023
@artusiep
Copy link
Contributor Author

artusiep commented Feb 25, 2023

Tested with Airbyte docker with normalization

image

@sajarin sajarin changed the title Adding missing columns for analytics streams for pinterest source Source Pinterest - Adding missing columns for analytics streams Mar 7, 2023
Copy link
Contributor

@sajarin sajarin left a comment

Choose a reason for hiding this comment

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

Hey @artusiep,

Thanks for the contribution, it looks like you're adding around 22 new columns to the analytics streams.

In the conftest.py, what's the reason behind removing the "windows_in_days" value?

Also there seems to be some merge conflicts, can you fix them?

@artusiep artusiep force-pushed the 22206-extend-metrics-in-anatytics-stream branch from 96639a3 to df908ac Compare March 8, 2023 11:18
@artusiep artusiep force-pushed the 22206-extend-metrics-in-anatytics-stream branch from df908ac to e6a8ef9 Compare March 8, 2023 11:20
@artusiep
Copy link
Contributor Author

artusiep commented Mar 8, 2023

Hey @sajarin

answering your question

Hey @artusiep,

Thanks for the contribution, it looks like you're adding around 22 new columns to the analytics streams.

Exactly this is the main purpose of this contribution. The list of columns are mentioned in Pull Request description

In the conftest.py, what's the reason behind removing the "windows_in_days" value?

windows_in_days parameter is simply not used anywhere, and it is not configurable. Take a look at: https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connectors/source-pinterest/source_pinterest/source.py#L44-L46 I just wanted do make a clean up of this variable as well

Also there seems to be some merge conflicts, can you fix them?

Merge conflict fixed

@artusiep artusiep requested a review from sajarin March 8, 2023 18:16
@sajarin
Copy link
Contributor

sajarin commented Mar 13, 2023

/test connector=connectors/source-pinterest

🕑 connectors/source-pinterest https://github.com/airbytehq/airbyte/actions/runs/4406909764
❌ connectors/source-pinterest https://github.com/airbytehq/airbyte/actions/runs/4406909764
🐛 https://gradle.com/s/uyjo523c2lip6

Build Failed

Test summary info:

=========================== short test summary info ============================ FAILED test_core.py::TestDiscovery::test_backward_compatibility[inputs0] - co... FAILED test_core.py::TestDiscovery::test_backward_compatibility[inputs1] - co... FAILED test_core.py::TestBasicRead::test_read[inputs0] - Failed: Stream board... SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:100: The previous and actual specifications are identical. ============= 3 failed, 43 passed, 1 skipped in 217.33s (0:03:37) ============== 
"client_secret": "client_secret",
"refresh_token": "refresh_token",
"start_date": "2020-06-01",
"window_in_days": 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you removing this parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As it is mentioned above:

In the conftest.py, what's the reason behind removing the "windows_in_days" value?

windows_in_days parameter is simply not used anywhere, and it is not configurable. Take a look at: https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connectors/source-pinterest/source_pinterest/source.py#L44-L46 I just wanted do make a clean up of this variable as well

I can rollback that but it is not going to be used

},
"CAMPAIGN_NAME": {
"type": ["null", "number"]
"type": ["null", "string"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Changing an existing schame you must edit the acceptance-test to skip the backward compatibility issue.

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 will try to understand how this backward compatibility acceptance tests works in order to mitigate that

Copy link
Contributor

Choose a reason for hiding this comment

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

Hello @artusiep sorry the long delay here. I submitted a few changes to correct integration tests.

@marcosmarxm marcosmarxm added the contributor-program PRs submitted through the contributor program. label Mar 17, 2023
@marcosmarxm marcosmarxm requested a review from a team March 17, 2023 14:19
@marcosmarxm
Copy link
Contributor

marcosmarxm commented Apr 1, 2023

/test connector=connectors/source-pinterest

🕑 connectors/source-pinterest https://github.com/airbytehq/airbyte/actions/runs/4583595799
✅ connectors/source-pinterest https://github.com/airbytehq/airbyte/actions/runs/4583595799
Python tests coverage:

Name Stmts Miss Cover -------------------------------------------------- source_pinterest/utils.py 8 0 100% source_pinterest/__init__.py 2 0 100% source_pinterest/source.py 224 18 92% -------------------------------------------------- TOTAL 234 18 92% 

Build Passed

Test summary info:

=========================== short test summary info ============================ SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:100: The previous and actual specifications are identical. SKIPPED [2] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:587: Backward compatibility tests are disabled for version 0.2.3. ================== 47 passed, 3 skipped in 208.23s (0:03:28) =================== 
Copy link
Contributor

@marcosmarxm marcosmarxm left a comment

Choose a reason for hiding this comment

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

Thanks @artusiep I'll request the final approval from the connector team to release the new version of your changes. This is going to happens next week but everything is ok from your side. Sorry again for the long delay to review the contribution.

@marcosmarxm marcosmarxm requested a review from lazebnyi April 3, 2023 13:51
Copy link
Contributor

@lazebnyi lazebnyi left a comment

Choose a reason for hiding this comment

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

LGTM! Need update strictness level for tests

@marcosmarxm
Copy link
Contributor

marcosmarxm commented Apr 3, 2023

/test connector=connectors/source-pinterest

🕑 connectors/source-pinterest https://github.com/airbytehq/airbyte/actions/runs/4599028209
✅ connectors/source-pinterest https://github.com/airbytehq/airbyte/actions/runs/4599028209
Python tests coverage:

Name Stmts Miss Cover -------------------------------------------------- source_pinterest/utils.py 8 0 100% source_pinterest/__init__.py 2 0 100% source_pinterest/source.py 224 18 92% -------------------------------------------------- TOTAL 234 18 92% 

Build Passed

Test summary info:

=========================== short test summary info ============================ SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:100: The previous and actual specifications are identical. SKIPPED [2] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:587: Backward compatibility tests are disabled for version 0.2.3. ================== 47 passed, 3 skipped in 212.08s (0:03:32) =================== 
@marcosmarxm marcosmarxm requested a review from lazebnyi April 3, 2023 16:54
Copy link
Contributor

@lazebnyi lazebnyi left a comment

Choose a reason for hiding this comment

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

LGTM!

@marcosmarxm
Copy link
Contributor

marcosmarxm commented Apr 3, 2023

/publish connector=connectors/source-pinterest

🕑 Publishing the following connectors:
connectors/source-pinterest
https://github.com/airbytehq/airbyte/actions/runs/4599612994


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

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

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 bounty community connectors/source/pinterest contributor-program PRs submitted through the contributor program.

5 participants