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 Marketo: New Stream Segmentation #23956

Merged
merged 18 commits into from May 12, 2023
Merged

Conversation

aazam-gh
Copy link
Contributor

What

Fixes #17547

How

Added new Stream Segmentation which returns list of segments from target segmentation

Recommended reading order

  1. x.java
  2. y.python

🚨 User Impact 🚨

No

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? 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
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions

Airbyter

Updating a connector

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

@aazam-gh aazam-gh changed the title Added Segmentation Stream Source Marketo: New Stream Segmentation Mar 13, 2023
@aazam-gh
Copy link
Contributor Author

image

Copy link
Member

@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.

Some comments.

Comment on lines 506 to 507
def path(self, **kwargs) -> str:
return f"rest/asset/v1/segmentation/{self.segment_id}/segments.json"
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue stated to add the stream which returns list of segments inside target segmentation

Copy link
Member

Choose a reason for hiding this comment

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

@YowanR this change adds a new spec field where users need to specify the segmentation they want to retrieve. If they need two or all it won't be possible. Marketo has the option to retrieve all segmentations and we could use that to be parent stream and do automatically retrieving all data. Any comments?

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 prefer that route as well because it makes it convenient as users would not need to search for the segmentIDs

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'll make the changes to have it return the entire segmentation. Is that alright?

Copy link
Member

Choose a reason for hiding this comment

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

No, I think this stream you created must retrieve the endpoint https://developers.marketo.com/rest-api/endpoint-reference/asset-endpoint-reference/#!/Segments/getSegmentationUsingGET and you must create another called Segments which uses the parent data (segmentation id) to retrieve the data for https://developers.marketo.com/rest-api/endpoint-reference/asset-endpoint-reference/#!/Segments/getSegmentsForSegmentationUsingGET

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So there won't be a segmentationId in the spec right? Also creating a stream which reads the segmentationId would then mean that it is returning the data of all the segments. Is that correct?

Copy link
Member

Choose a reason for hiding this comment

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

You're correct. you must create the parent stream to retrieve all segmentations and other to read the segments. Take a look in https://docs.airbyte.com/connector-development/cdk-python/http-streams#nested-streams--caching

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@marcosmarxm are there any already implemented nested streams that you know of which I can refer to get a better understanding of it?

@marcosmarxm marcosmarxm added the contributor-program PRs submitted through the contributor program. label Apr 3, 2023
@sajarin
Copy link
Contributor

sajarin commented Apr 5, 2023

Hey thanks for the contribution and apologies for the delay!

I'll be the DRI responsible for reviewing this and getting it across the finish line. We currently have a backlog of about a dozen PRs, but just wanted to let you know that this PR has been added to the queue and I'll be trying my best to get to this as soon as possible.

Thanks for the contribution and for being patient :)

@aazam-gh
Copy link
Contributor Author

aazam-gh commented Apr 5, 2023

Hello and thank you for adding it to the list :D
Of course I understand things at Airbyte can get busy busy, I look forward to getting this PR finished and merged!

@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Apr 18, 2023
@marcosmarxm
Copy link
Member

marcosmarxm commented Apr 19, 2023

/test connector=connectors/source-marketo

🕑 connectors/source-marketo https://github.com/airbytehq/airbyte/actions/runs/4743625532

@marcosmarxm
Copy link
Member

marcosmarxm commented Apr 20, 2023

/test connector=connectors/source-marketo

🕑 connectors/source-marketo https://github.com/airbytehq/airbyte/actions/runs/4753653269

Copy link
Member

@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 for the contribution @Alcadeus0 rigth now Marketo is timing out integration tests. I request the connector team to take a look. There isn't anything pending from your side.

@marcosmarxm
Copy link
Member

marcosmarxm commented May 4, 2023

/test connector=connectors/source-marketo

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

Name                         Stmts   Miss  Cover
------------------------------------------------
source_marketo/__init__.py       2      0   100%
source_marketo/utils.py         33      1    97%
source_marketo/source.py       292     34    88%
------------------------------------------------
TOTAL                          327     35    89%

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.
================== 39 passed, 1 skipped in 4802.78s (1:20:02) ==================

Copy link
Collaborator

@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! Minor comment for documentation.

@@ -106,6 +106,7 @@ If the 50,000 limit is too stringent, contact Marketo support for a quota increa

| Version | Date | Pull Request | Subject |
|:---------|:-----------|:---------------------------------------------------------|:----------------------------------------------------------------------------------------------|
| `1.1.0` | 2023-04-18 | [23956](https://github.com/airbytehq/airbyte/pull/23956) | Add `Segmentations` Stream |
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need add stream to the Supported Streams section.

@marcosmarxm
Copy link
Member

marcosmarxm commented May 12, 2023

/publish connector=connectors/source-marketo

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


Connector Version Did it publish? Were definitions generated?
connectors/source-marketo 1.1.0

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

@marcosmarxm marcosmarxm merged commit 53658ac into airbytehq:master May 12, 2023
38 of 51 checks passed
@aazam-gh aazam-gh deleted the segments branch June 7, 2023 16:58
marcosmarxm added a commit to natalia-miinto/airbyte that referenced this pull request Jun 8, 2023
* Added Segmentation Stream

* change endpoint to read all segments

* remove unused params

* add json schema header

* bump connector version and update doc

* remove f-string not used

* fix schema and correct segmentations base stream class

* remove incremental from int test segmenations config cat

* fix segmentations params

* add expected records

* Update marketo.md

* bump the metadata file

* auto-bump connector version

---------

Co-authored-by: Marcos Marx <marcosmarxm@users.noreply.github.com>
Co-authored-by: marcosmarxm <marcosmarxm@gmail.com>
Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.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 bounty community connectors/source/marketo contributor-program PRs submitted through the contributor program. ga-connector-change gl-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source Marketo: new stream Segments
6 participants