-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Determine this is the right repository
- I determined this is the correct repository in which to report this bug.
Summary of the issue
Context
The type Shipping (belong in /shopping/merchant_products_v1/types/products_common.py) have two missing fields (handling_cutoff_time & handling_cutoff_timezone) compared to Google Merchant API documentation & Google discovery document
Google Merchant Product discovery document : https://merchantapi.googleapis.com/$discovery/rest?version=products_v1
Google Merchant API documentation : https://developers.google.com/merchant/api/reference/rpc/google.shopping.merchant.products.v1#shipping
Expected Behavior:
No error raised when one of those two field is specified to update/insert a product
Actual Behavior:
We can't specify those two fields when a ProductInput is required in a request, for example insert/update product. A ValueError is raised :
ValueError: Unknown field for Shipping: handling_cutoff_timezone
Stack Trace
ERROR:2026-02-19 10:13:52,731 -- Error during product operation
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/proto/marshal/rules/message.py", line 36, in to_proto
return self._descriptor(**value)
TypeError: 'str' object cannot be interpreted as an integer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/proto/marshal/rules/message.py", line 36, in to_proto
return self._descriptor(**value)
TypeError: 'str' object cannot be interpreted as an integer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/products.py", line 466, in product_update
product_input=ProductInput(product),
File "/usr/local/lib/python3.10/site-packages/proto/message.py", line 728, in __init__
pb_value = marshal.to_proto(pb_type, value)
File "/usr/local/lib/python3.10/site-packages/proto/marshal/marshal.py", line 235, in to_proto
pb_value = self.get_rule(proto_type=proto_type).to_proto(value)
File "/usr/local/lib/python3.10/site-packages/proto/marshal/rules/message.py", line 46, in to_proto
return self._wrapper(value)._pb
File "/usr/local/lib/python3.10/site-packages/proto/message.py", line 728, in __init__
pb_value = marshal.to_proto(pb_type, value)
File "/usr/local/lib/python3.10/site-packages/proto/marshal/marshal.py", line 218, in to_proto
return type(value)(self.to_proto(proto_type, i) for i in value)
File "/usr/local/lib/python3.10/site-packages/proto/marshal/marshal.py", line 218, in <genexpr>
return type(value)(self.to_proto(proto_type, i) for i in value)
File "/usr/local/lib/python3.10/site-packages/proto/marshal/marshal.py", line 235, in to_proto
pb_value = self.get_rule(proto_type=proto_type).to_proto(value)
File "/usr/local/lib/python3.10/site-packages/proto/marshal/rules/message.py", line 46, in to_proto
return self._wrapper(value)._pb
File "/usr/local/lib/python3.10/site-packages/proto/message.py", line 724, in __init__
raise ValueError(
ValueError: Unknown field for Shipping: handling_cutoff_timezone
API client name and version
google-shopping-merchant-products = 1.3.0
Reproduction steps: code
from google.shopping import (
merchant_products_v1,
)
credentials = "MY_CREDENTIALS"
datasource = "my_datasource"
product = {
"content_language": "fr",
"offer_id": "9628548530525",
"feed_label": "test",
"product_attributes": {
"price": {"currency_code": "EUR", "amount_micros": "1000000"},
"shipping_height": {"unit": "cm", "value": 55.0},
"image_link": "https://www.example.com/image.jpg",
"shipping": [
{
"postal_code": "44200",
"region": "fr",
"price": {"currency_code": "EUR", "amount_micros": "4000000"},
"handling_cutoff_timezone": "Europe/Zurich",
"max_transit_time": "5",
"min_handling_time": "2",
"min_transit_time": "5",
"country": "fr",
}
],
"availability": "IN_STOCK",
"product_width": {"value": 4.0, "unit": "cm"},
"product_height": {"value": 5.0, "unit": "cm"},
"title": "title",
"gtins": ["3234567890126"],
"product_length": {"value": 55.0, "unit": "cm"},
"description": "description",
"product_weight": {"unit": "kg", "value": 55.0},
"link": "https://www.example.com/product1",
},
"name": "accounts/124659270/productInputs/ZnJ-dGVzdH45NjI4NTQ4NTMwNTI1",
}
client = merchant_products_v1.ProductInputsServiceClient(
credentials=credentials,
)
result = client.update_product_input(
request=merchant_products_v1.UpdateProductInputRequest(
product_input=merchant_products_v1.ProductInput(product),
data_source=datasource,
)
)Reproduction steps: supporting files
No response
Reproduction steps: actual results
Reproduction steps: expected results
No response
OS & version + platform
Ubuntu 24.04.3 LTS
Python environment
3.10.19
Python dependencies
No response
Additional context
No response