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 Salesloft: added new emails incremental stream #11239

Merged

Conversation

yannibenoit
Copy link
Contributor

@yannibenoit yannibenoit commented Mar 17, 2022

What

Issue: #11198
Community Slack Message: https://airbytehq.slack.com/archives/C01VDDEGL7M/p1647435938137639

New source added for Salesloft integration -> activities/emails.json

image

How

  • Added new schema for this new endpoint -> emails.json
  • Added new IncrementalSalesloftStream class -> Emails
  • Edited streams method in SourceSalesloft class to add new class in return
  • Edited test_source.py to allow one more stream when unit testing

Recommended reading order

  1. emails.json
  2. source.py
  3. test_source.py

🚨 User Impact 🚨

New stream will be available in connector settings

image

New tables will be available in destination

**
image
**

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.

@github-actions github-actions bot added the area/connectors Connector related issues label Mar 17, 2022
@yannibenoit yannibenoit changed the title add :: salesloft-source :: added new emails source 🎉 source Salesloft: added new emails incremental stream Mar 17, 2022
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Mar 17, 2022
@CLAassistant
Copy link

CLAassistant commented Mar 17, 2022

CLA assistant check
All committers have signed the CLA.

@alafanechere
Copy link
Contributor

Thank you @yannibenoit for the contribution. I'll run the acceptance tests and go for a first review asap.

@alafanechere alafanechere self-assigned this Mar 21, 2022
@alafanechere
Copy link
Contributor

alafanechere commented Mar 22, 2022

/test connector=connectors/source-salesloft

🕑 connectors/source-salesloft https://github.com/airbytehq/airbyte/actions/runs/2021144817
✅ connectors/source-salesloft https://github.com/airbytehq/airbyte/actions/runs/2021144817
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              275    106    61%
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                                                  876    259    70%
Name                                                                                                                            Stmts   Miss  Cover
---------------------------------------------------------------------------------------------------------------------------------------------------
base_python/cdk/utils/casing.py                                                                                                     4      0   100%
base_python/__init__.py                                                                                                            13      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/airbyte_protocol.py     124      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/__init__.py               1      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/__init__.py                      2      0   100%
base_python/cdk/utils/event_timing.py                                                                                              47      3    94%
base_python/cdk/streams/auth/core.py                                                                                                8      1    88%
base_python/cdk/streams/exceptions.py                                                                                              10      2    80%
base_python/cdk/streams/auth/token.py                                                                                               9      4    56%
base_python/logger.py                                                                                                              33     15    55%
base_python/cdk/streams/rate_limiting.py                                                                                           30     14    53%
base_python/integration.py                                                                                                         52     25    52%
base_python/cdk/streams/http.py                                                                                                    67     33    51%
base_python/cdk/streams/core.py                                                                                                    63     32    49%
base_python/client.py                                                                                                              56     33    41%
base_python/catalog_helpers.py                                                                                                     10      6    40%
base_python/source.py                                                                                                              51     34    33%
base_python/cdk/streams/auth/oauth.py                                                                                              37     26    30%
base_python/cdk/abstract_source.py                                                                                                 89     64    28%
base_python/schema_helpers.py                                                                                                      56     41    27%
base_python/entrypoint.py                                                                                                          70     56    20%
---------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                                                             832    389    53%
Name                           Stmts   Miss  Cover
--------------------------------------------------
source_salesloft/__init__.py       2      0   100%
source_salesloft/source.py        82     18    78%
--------------------------------------------------
TOTAL                             84     18    79%

Copy link
Contributor

@alafanechere alafanechere left a comment

Choose a reason for hiding this comment

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

Thank you @yannibenoit for this contribution! I made a small suggestion about nullable fields.

"type": "object",
"properties": {
"id": {
"type": ["null", "integer"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"type": ["null", "integer"]
"type": "integer"

Please double-check which fields are nullable, here for example id is probably not nullable. The updated_at field should also not be nullable if you want to use it as the cursor field. If Salesloft does not provide this information please at lease set the following field as not nullable:
id, created_at, updated_at

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alafanechere sorry, bad copy paste ....
do you want me to apply the changes ? 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes please @yannibenoit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but @alafanechere we have a similar problem on other schemas 🤔
id, created_at, updated_at are nullable on the following schemas:

  • cadences.json
  • people.json
  • cadence_memberships.json

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made the changes for all schema , let's try out

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please only change your stream's schema to make this PR atomic, and maybe open a second one for other streams?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep done ✅
i have to make another pull requests for new endpoints/streams anyway so best practice is to make one PR per endpoint + 1 PR to adjust the schema of existing streams

Copy link
Contributor

Choose a reason for hiding this comment

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

As this PR is aimed at adding a new stream I find it better to not refactor the other streams in the same PR.
If you're working on PR to change the existing stream feel free to change their schema in this new PR too.
Or if you prefer to align all the schemas in a single PR feel free to do it too.

@alafanechere
Copy link
Contributor

alafanechere commented Mar 23, 2022

/publish connector=connectors/source-salesloft

🕑 connectors/source-salesloft https://github.com/airbytehq/airbyte/actions/runs/2029828403
✅ connectors/source-salesloft https://github.com/airbytehq/airbyte/actions/runs/2029828403

Copy link
Contributor

@alafanechere alafanechere left a comment

Choose a reason for hiding this comment

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

Thank you for the changes, publishing now 🎉

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.

None yet

4 participants