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

ref(source-stripe): remove stripe py-package #45348

Merged
merged 5 commits into from
Sep 10, 2024

Conversation

artem1205
Copy link
Collaborator

@artem1205 artem1205 commented Sep 9, 2024

What

refactor to remove python package stripe

Reason:

  • bypass SSL limitation on internal regression tests.
  • used only in check and can be replaced with existing HttpStream implementation.

How

remove python stripe package

Review guide

  1. airbyte-integrations/connectors/source-stripe/source_stripe/source.py

User Impact

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

[skip ci]

Signed-off-by: Artem Inzhyyants <artem.inzhyyants@gmail.com>
Copy link

vercel bot commented Sep 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Sep 10, 2024 1:06pm

Signed-off-by: Artem Inzhyyants <artem.inzhyyants@gmail.com>
Signed-off-by: Artem Inzhyyants <artem.inzhyyants@gmail.com>
@artem1205 artem1205 marked this pull request as ready for review September 10, 2024 09:15
@artem1205 artem1205 requested a review from a team September 10, 2024 09:16
@artem1205
Copy link
Collaborator Author

Regression tests failed only for control version.

Copy link
Contributor

@maxi297 maxi297 left a comment

Choose a reason for hiding this comment

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

I think we should ensure that we don't prevent alerting when needed. The rest looks good to me

stream_is_available, reason = availability_strategy.check_availability(account_stream, logger)
if not stream_is_available:
return False, reason
except Exception as error:
Copy link
Contributor

Choose a reason for hiding this comment

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

If we catch all the exceptions here, we might hide some system errors that should have trigger paging. We should probably do something similar as this PR where we only catch AirbyteTracedException of type config error

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I reused logic from Declarative Stream check and HttpAvailabilityStrategy. Seems like we need to redo declarative check as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah... rip! For the HttpAvailabilityStrategy, I think this is known and we discussed that we would move away from it as we would delete the availability strategy. I don't know where we are at with this. For the DeclarativeStream, it seems like a problem too.

@@ -107,12 +108,26 @@ def validate_and_fill_with_defaults(config: MutableMapping[str, Any]) -> Mutable
return config

def check_connection(self, logger: logging.Logger, config: MutableMapping[str, Any]) -> Tuple[bool, Any]:
self.validate_and_fill_with_defaults(config)
stripe.api_key = config["client_secret"]
config = self.validate_and_fill_with_defaults(config)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: the logic to prepare the config seems very similar than the one in streams. Should we extract that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

agreed, done

[skip ci]

Signed-off-by: Artem Inzhyyants <artem.inzhyyants@gmail.com>
Signed-off-by: Artem Inzhyyants <artem.inzhyyants@gmail.com>
@artem1205 artem1205 requested a review from maxi297 September 10, 2024 14:18
Copy link
Contributor

@maxi297 maxi297 left a comment

Choose a reason for hiding this comment

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

LGTM!

@artem1205
Copy link
Collaborator Author

artem1205 commented Sep 10, 2024

/approve-regression-tests

Check job output.

✅ Approving regression tests

@artem1205 artem1205 merged commit 21348af into master Sep 10, 2024
35 checks passed
@artem1205 artem1205 deleted the artem1205/source-stipe-ref-http branch September 10, 2024 14:24
@tcboles
Copy link
Contributor

tcboles commented Sep 10, 2024

This PR does not allow for tokens that do not have read access to all platform connected accounts. I am getting the following error.

The endpoint https://api.stripe.com/v1/accounts?limit=100 returned 400: Bad Request. You cannot access the connected accounts of your platform's connected accounts.. Please visit https://docs.airbyte.com/integrations/sources/stripe to learn more. You cannot access the connected accounts of your platform's connected accounts.

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 connectors/source/stripe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants