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 Plaid: port to Python CDK #7977

Merged
merged 20 commits into from
Jan 10, 2022
Merged

Conversation

firmbase-tal
Copy link
Contributor

@firmbase-tal firmbase-tal commented Nov 15, 2021

What

Reformatted plaid to be written in Python instead of Javascript: #3998
Added transaction functionality to the source.

How

The new Python connector works with the Plaid API package to draw data, then extracts the relevant data to stream, and dumps it as messages.
Balance stream maintains data structure from previous connector version.

Recommended reading order

Chef's choice. 😄

Pre-merge Checklist

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
  • Credentials added to Github CI. 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

@CLAassistant
Copy link

CLAassistant commented Nov 15, 2021

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the area/connectors Connector related issues label Nov 15, 2021
@firmbase-tal firmbase-tal changed the title Plaid source update Migrate plaid source to Python CDK and add transaction functionality Nov 15, 2021
@alafanechere alafanechere self-assigned this Nov 15, 2021
@alafanechere
Copy link
Contributor

alafanechere commented Nov 18, 2021

Hi @firmbase-tal , thanks for this contribution! Could you please share evidence that acceptance tests are passing on your side?
Command to run from top level airbyte directory:

./gradlew :airbyte-integrations:connectors:source-plaid:integrationTest

Please also run:

./gradlew bash

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.

I made a first quick review of the core and my main concern is that I feel like the abstractions you defined thanks to configs/PlaidStream/PlaidRequester are a bit far-fetched. I'm not 100% sure of the interest of storing some streams configurations in an external json file.
I think that you can make your connector more readable by having the following classes:

  • PlaidStream(Stream)
  • BalanceStream(PlaidStream)
  • IncrementalTransactionStream(PlaidStream)

And IMO the PlaidRequesters method could be brought back to the child classes above.

Let me know what you think about this!

- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
empty_streams: []
# TODO uncomment this block to specify that the tests should assert the connector outputs the records provided in the input file a file
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove all TODO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @firmbase-tal , thanks for this contribution! Could you please share evidence that acceptance tests are passing on your side? Command to run from top level airbyte directory:

./gradlew :airbyte-integrations:connectors:source-plaid:integrationTest

Please also run:

./gradlew bash
./gradlew bash

This fails with error: Task 'bash' not found in root project 'airbyte'.
I'm unsure as to what went wrong there.

Also, where should I upload the files from the acceptance tests?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry it was a typo for my side I meant ./gradlew format

@alafanechere
Copy link
Contributor

Hi @firmbase-tal, are you still interested in moving this PR forward according to my review?

@alafanechere
Copy link
Contributor

I add the label blocked until the user reply the review.

Co-authored-by: Augustin <augustin@airbyte.io>
@firmbase-tal
Copy link
Contributor Author

Yes, apologies for the delay, will handle the changes soon.

@hbd
Copy link

hbd commented Dec 23, 2021

Thanks for your work here @firmbase-tal. Let me know if I can help get this over the line.

@firmbase-tal
Copy link
Contributor Author

I think I fixed everything for now, please let me know if further changes are necessary.

@alafanechere
Copy link
Contributor

Hi @firmbase-tal, thanks for the changes; I'll go for another review this week then! @hbd feel free to review too if you're familiar with Plaid 😄

@alafanechere alafanechere mentioned this pull request Dec 30, 2021
@alafanechere alafanechere temporarily deployed to more-secrets December 30, 2021 18:28 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets December 30, 2021 18:29 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets January 4, 2022 14:00 Inactive
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Jan 5, 2022
@alafanechere alafanechere temporarily deployed to more-secrets January 5, 2022 18:25 Inactive
@alafanechere
Copy link
Contributor

@firmbase-tal I allowed myself to make some changes to simplify the code.
Mainly:

  • Schemas are usually declared in external json files.
  • The PlaidRequester class and some abstraction logic looked redundant to me.

Let me know what you think about these.

@jrhizor jrhizor temporarily deployed to more-secrets January 5, 2022 18:27 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets January 5, 2022 18:30 Inactive
Copy link

@hbd hbd left a comment

Choose a reason for hiding this comment

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

LGTM. I was able to build the image locally and, although I am not very familiar with the Plaid API, the spec looks good

@alafanechere alafanechere changed the title Migrate plaid source to Python CDK and add transaction functionality Source Plaid: port to Python CDK Jan 6, 2022
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.

I confirm acceptance tests are passing. I'm publishing this now.

@jrhizor jrhizor temporarily deployed to more-secrets January 6, 2022 18:08 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets January 6, 2022 18:18 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets January 7, 2022 07:37 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets January 7, 2022 08:15 Inactive
@alafanechere alafanechere temporarily deployed to more-secrets January 7, 2022 14:50 Inactive
@hbd
Copy link

hbd commented Jan 10, 2022

Just confirming that I ran latest locally and successfully synced Plaid Sandbox data.

@alafanechere alafanechere temporarily deployed to more-secrets January 10, 2022 08:28 Inactive
@alafanechere alafanechere merged commit e68c564 into airbytehq:master Jan 10, 2022
@alafanechere
Copy link
Contributor

Thank you @hbd for testing and @firmbase-tal for your original contribution!

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/plaid
Projects
No open projects
Status: No status
Development

Successfully merging this pull request may close these issues.

8 participants