You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Setting a List Field to [] When Modifying a Resource Doesn't Actually Empty The List Field #802
returns successfully but doesn't clear out the blocked_categories on the cardholder and returns a cardholder instance with the previous blocked_categories list still set.
and that successfully clears the list of blocked_categories—however, there is no mention of the need to make this distinction when calling stripe.issuing.Cardholder.modify or any other method in the Stripe API docs or this library's docs and setting a list to empty by setting its value to "" is not valid Python syntax.
complete any requested test KYB information to ensure the account is fully verified and approved
create a cardholder via:
stripe.issuing.Cardholder.create(
name="Jane Doe",
email="testcardholder@emailprovider.com",
status="active",
type="individual",
billing={
"name": "Jane Doe",
"address": {
"line1": "117 West St",
"line2": None,
"city": "New York",
"state": "NY",
"country": "US",
"postal_code": "10006",
},
},
spending_controls={'blocked_categories': ['floor_covering_stores']},
stripe_account="acct_...", # id of the account created above
)
attempt to update the cardholder via:
stripe.issuing.Cardholder.modify(
"ich_...", # id of the cardholder created abovespending_controls={'blocked_categories': []},
stripe_account="acct_...", # id of the account created above
)
Expected behavior
Setting a list to [] should set that list to empty. It is not intuitive or valid Python syntax to set a list to empty by setting its value to "".
Code snippets
See code snippets in the "Describe the bug" and "To Reproduce" sections
Somewhat related issue, some users have requested setting objects like Metadata to None should result in transmitting the empty string to unset: #753 (comment)
Activity
richardm-stripe commentedon Oct 14, 2022
Somewhat related issue, some users have requested setting objects like
MetadatatoNoneshould result in transmitting the empty string to unset: #753 (comment)fix: encode empty list/tuple as (key, '') to clear array fields
fix: encode empty list/tuple as empty string to clear list fields (#1)