-
Notifications
You must be signed in to change notification settings - Fork 424
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
del StripeOject.metadata['some_key']
deletes key AND raises KeyError
#596
Comments
Hi @apinsard, thanks for the report. You can unset metadata keys like this: stripe.PaymentIntent.modify('pi_deadbeef', metadata={'damage_deposit_amount': ''}) or like this: pi = stripe.PaymentIntent.retrieve('pi_deadbeef')
pi.metadata['damage_deposit_amount'] = None
pi.save() Nevertheless, the |
Thank you for the quick answer and the provided workaround! |
I just released version 2.33.1, using |
python: 3.5.3
stripe-python: 2.29.4
I just experienced quite unexpected
KeyError
exception the following code:According to the information I have in my error report
'damage_deposit_amount'
is indeed not inpi.metadata
. So, I first thought'key' in StripeObject
always returnsTrue
.However, after testing it in a python console I figured out the following:
To sum it up:
del pi.metadata['damage_deposit_amount']
deleted the key, but raised a KeyError.The text was updated successfully, but these errors were encountered: