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

Fix invalid keyword argument error when requesting a list from Stripe #3479

Merged

Conversation

jdvermeire
Copy link
Contributor

Description

Removed the kwargs decorator (double asterisks) from the params argument sent to StripeObject._request in the new_list method that overrides Stripe's ListObject.list method. This was causing an "invalid keyword argument 'limit'" when running the Mage Stripe source ingestion block.

How Has This Been Tested?

Spot tested locally (since this is a minor change [two characters] and there is no current tests for mage_integrations.sources.stripe.

Steps to reproduce test:

  1. Open python in a terminal
  2. Copy and paste imports, new_list definition, and ListObject.list = new_list statements into terminal
  3. Make a list call to a Stripe endpoint like stripe.Customer.list(api_key="<insert_api_key>", limit=100)
  4. Call should return successfully

Checklist

  • The PR is tagged with proper labels (bug, enhancement, feature, documentation)
  • I have performed a self-review of my own code
  • I have added unit tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

cc:
@wangxiaoyou1993, @dy46, @johnson-mage, @tommydangerous

…argument instead of a standard argument named "params". This was causing an error when calling the StripeObject._request method as it expects params to be passed as a standard argument.
@jdvermeire jdvermeire marked this pull request as ready for review September 12, 2023 18:09
@jdvermeire
Copy link
Contributor Author

If I get some spare cycles, I'll work on writing unit tests for the whole module.

@wangxiaoyou1993
Copy link
Member

Hi @jdvermeire , could you fix the errors in the code quality check?
You can also install pre-commit hook locally: https://github.com/mage-ai/mage-ai/blob/master/README_dev.md

@jdvermeire
Copy link
Contributor Author

@wangxiaoyou1993 Fixed formatting, spelling, and grammatical errors.

@wangxiaoyou1993 wangxiaoyou1993 added the bug Something isn't working label Sep 27, 2023
@wangxiaoyou1993 wangxiaoyou1993 merged commit cd28f8a into mage-ai:master Sep 27, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants