Missing `convert_to_dict` export
stianjensen opened this issue · 3 comments
Describe the bug
In 2.22 a function convert_to_dict
was added:
https://github.com/stripe/stripe-python/blob/master/CHANGELOG.md#2220---2019-03-14
#541
After upgrading to 8.x we've started getting warnings that we cannot import from stripe.util anymore, which is fine, but I cannot find anything in the changelog about where we're supposed to import this function from instead now? I only find documentation about convert_to_stripe_object.
Since it was mentioned in the changelog that the function was added I would expect the changelog to also mention a migration path for it now?
To Reproduce
- Install version 8.0.0 of the Stripe SDK for python
- Run
from stripe.util import convert_to_dict
- Observe that you receive a deprecation warning now that didn't use to be there:
DeprecationWarning:
The stripe.util package is deprecated, please change your
imports to import from stripe directly.
From:
from stripe.util import convert_to_stripe_object
To:
from stripe import convert_to_stripe_object
from stripe.util import convert_to_dict
Expected behavior
Either no deprecation warning, or at least a notice in the changelog about where to now import the function from.
Code snippets
No response
OS
macOS
Language version
Python 3.12
Library version
stripe-python 8.0.0
API version
2019-12-03
Additional context
No response
Hi @stianjensen, thank you for your report.
Do you mind sharing your use case for convert_to_dict
? The StripeObject base class already inherits from dict
, so all the convert_to_dict
does is "strips" the StripeObject
base class.
Ah, thanks for the clarification. I'll look into just getting rid of our use of that function call altogether, then!
I'll close the issue. Please feel free to reopen if you find a use case that's not covered.