-
Notifications
You must be signed in to change notification settings - Fork 55
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
add several list filtering improvements #186
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Thomas, these additions are pretty clean! I have a few comments, but nothing blocking.
thanks for the comments, will make the changes towards the weekend |
2963005
to
53f0024
Compare
so i amended the history with the changes as suggested. and sorry in advance for the scope creep: i also added a couple of flake8 fixes and two lines to the gitignore (pycharm directories and the default .venv folder). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @thrau!
Awsome PR, these are simple and efficient improvements of localstripe.
I have no doubt they will be integrated soon.
I have a few feedback and proposition for you, I hope it's OK.
Also thanks for fixing flake8!
For .gitignore
I'm -0.5 for .venv
and -1 for .idea
. These are specific to your environment, localstripe doesn't need them and we try to keep things minimal.
i updated the PR with your change requests @H--o-l, hope to get this over the line now |
with respect to the stripe does return an error on unknown arguments. however the error message is completely different from what localstripe returns:
i mean sure, i'll add the assert to the methods i added (it's your project of course, so your decision). however
which is all fine i suppose, just something to think about. anyway. i made all the requested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks again Thomas for your contribution.
- some existing code is still inconsistent (e.g.,
PaymentMethod._api_list_all
doesn't do the check either.
True. PaymentMethod._api_list_all
should do it too.
- i think this impedes the use of localstripe. some list APIs don't have all the existing optional arguments in their signatures, so using any of the query functionality that exists in stripe but isn't implemented in localstripe will break user code, which i think is worse than not getting errors back for requests that have invalid parameters. mostly you will use stripe clients to talk to the stripe server, which will check that stuff anyway.
Also true, but on the other hand it's helpful to get user-friendly error message when developing, e.g. "you passed argument typo
, which is not accepted". Maybe the error message should be adapted, for instance like the following?
"Received unknown parameter: foo. It's either incorrect or not yet supported by localstripe."
@H--o-l thanks a lot for the review 🙂
Closes #188.
if object is not None: | ||
assert type(object) is str | ||
assert object in ['card', 'bank_account'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for implementing it in the end 👍
This PR adds several improvements to listing products, plans, customers, and subscriptions (stripe features that we use at @localstack)
/v1/products
to take the optionalactive=true|false
keyword/v1/plans
object=card
filter argument to/v1/customers/{id}/sources
trial_from_plan
boolean flag for/v1/subscriptions
I tried to conform to the semantic commit messages i found in the history, and tried to keep the code style as close to the original code as possible.
Happy to make changes.