goshippo / shippo-python-client

Shipping API Python library (USPS, FedEx, UPS and more)
https://goshippo.com/docs
MIT License
123 stars 70 forks source link

Deep copy exception #54

Closed scottyroges closed 2 years ago

scottyroges commented 5 years ago

We are seeing the below error in the parcels field when trying to create a shipment. Nothing seems to have changed on our side and we are not passing in the metadata field, so I assume the python client is doing that. Has anyone else encountered this?

{ "request": { "address_from": { "city": "Test", "name": "Scott Rogener", "zip": "10010", "street1": "123 Test St", "street2": null, "phone": "1234567890", "state": "NY", "country": "US", "email": "test@gmail.com" }, "parcel": { "weight": "5.1", "distance_unit": "in", "mass_unit": "lb", "height": "5.5", "width": "19.3", "length": "25.5" }, "address_to": { "city": "Test", "name": "Peloton Interactive, Inc", "zip": "10010", "street1": "456 East QA Blvd", "street2": null, "phone": null, "state": "NY", "country": "US", "email": "test@gmail.com" } }, "response": { "status": "SUCCESS", "customs_declaration": null, "object_updated": "2019-08-28T12:42:44.980Z", "object_created": "2019-08-28T12:42:44.980Z", "extra": {}, "object_owner": "test@test.com", "messages": [], "address_to": { "city": "Mt. Vernon", "street2": "", "name": "Peloton Interactive, Inc", "zip": "10550", "street1": "456 East QA Blvd", "company": "", "street3": "", "street_no": "", "object_id": "d335de350bb04bc5a5bb0f187ea6e67b", "email": "test@gmail.com", "phone": "", "state": "NY", "is_residential": null, "test": true, "country": "US", "validation_results": {}, "is_complete": true }, "parcels": "deepcopy exception You cannot set metadata to an empty string. We interpret empty strings as None in requests.You may set {\n \"distance_unit\": \"in\", \n \"extra\": {}, \n \"height\": \"5.5000\", \n \"length\": \"25.5000\", \n \"line_items\": [], \n \"mass_unit\": \"lb\", \n \"object_created\": \"2019-08-28T12:42:44.951Z\", \n \"object_id\": \"7ce13bb2cd77440ab07833f969dd200b\", \n \"object_owner\": \"test@onepeloton.com\", \n \"object_state\": \"VALID\", \n \"object_updated\": \"2019-08-28T12:42:44.999Z\", \n \"template\": null, \n \"test\": true, \n \"value_amount\": null, \n \"value_currency\": null, \n \"weight\": \"5.1000\", \n \"width\": \"19.3000\"\n}.metadata = None to delete the property for: [<ShippoObject object_id=7ce13bb2cd77440ab07833f969dd200b at 0x7f7abae8bd08> JSON: {\n \"distance_unit\": \"in\", \n \"extra\": {}, \n \"height\": \"5.5000\", \n \"length\": \"25.5000\", \n \"line_items\": [], \n \"mass_unit\": \"lb\", \n \"metadata\": \"\", \n \"object_created\": \"2019-08-28T12:42:44.951Z\", \n \"object_id\": \"7ce13bb2cd77440ab07833f969dd200b\", \n \"object_owner\": \"test@onepeloton.com\", \n \"object_state\": \"VALID\", \n \"object_updated\": \"2019-08-28T12:42:44.999Z\", \n \"template\": null, \n \"test\": true, \n \"value_amount\": null, \n \"value_currency\": null, \n \"weight\": \"5.1000\", \n \"width\": \"19.3000\"\n}]", "address_return": { "city": "Test", "street2": "", "name": "Scott Rogener", "zip": "10010", "street1": "123 Test Street", "company": "", "street3": "", "street_no": "", "object_id": "aa720634d10b490aa5e3d6a43919f659", "email": "test@gmail.com", "phone": "1234567890", "state": "NY", "is_residential": null, "test": true, "country": "US", "validation_results": {}, "is_complete": true }, "shipment_date": "2019-08-28T12:42:44.950Z", "object_id": "b7c8aed9a7f7429db413c0df058bd2a6", "rates": [], "test": true, "address_from": { "city": "Test", "street2": "", "name": "Scott Rogener", "zip": "10010", "street1": "123 Test Street", "company": "", "street3": "", "street_no": "", "object_id": "aa720634d10b490aa5e3d6a43919f659", "email": "test@gmail.com", "phone": "1234567890", "state": "NY", "is_residential": null, "test": true, "country": "US", "validation_results": {}, "is_complete": true }, "alternate_address_to": null, "carrier_accounts": [], "order": null, "metadata": "" } }

jfriedr commented 2 years ago

@scottyroges apologies this was missed. I'm going to go ahead and close out this issue but am more than happy to help dig into this is you are still seeing this behavior.