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

Missing convert_to_dict export #1263

Closed
stianjensen opened this issue Feb 28, 2024 · 3 comments
Closed

Missing convert_to_dict export #1263

stianjensen opened this issue Feb 28, 2024 · 3 comments
Labels

Comments

@stianjensen
Copy link
Contributor

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

  1. Install version 8.0.0 of the Stripe SDK for python
  2. Run from stripe.util import convert_to_dict
  3. 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

@pakrym-stripe
Copy link
Contributor

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.

@stianjensen
Copy link
Contributor Author

Ah, thanks for the clarification. I'll look into just getting rid of our use of that function call altogether, then!

@pakrym-stripe
Copy link
Contributor

I'll close the issue. Please feel free to reopen if you find a use case that's not covered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants