i am trying to import my catalog ( which i uploaded to bucket as json format) but it gives error
{"code":3,"message":"Parsing terminated before end of input.
i copied the data from sample json as given here
but the error is same.
here is my json which i copied from reference website
{ "id": "1234", "category_hierarchies": [ { "categories": [ "athletic wear", "shoes" ] } ], "title": "ABC sneakers" }}
{ "id": "5839", "category_hierarchies": [ { "categories": [ "casual attire", "t-shirts" ] } ], "title": "Crew t-shirt" }}
and here is the error
{"code":3,"message":"Parsing terminated before end of input.\n: \"ABC sneakers\" }}\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":1}}]} {"code":3,"message":"Parsing terminated before end of input.\n: \"Crew t-shirt\" }}\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":2}}]}
i will really appreciate any help
--
You received this message because you are subscribed to the Google Groups "cloud-recommendations-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-recommendatio...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-recommendations-users/392f1bdc-c193-4c3d-aca0-d3e2c5dff915n%40googlegroups.com.
Thank you so much Peng for your quick response. I am using online portal for data import here I do not know the version. As i am using the GUI version and I have also tried the JSON schema which you mentioned here. But still it is giving error. Below is the JSon i am using now.
{
"id": "WAG141579D",
"categories": "Apparel & Accessories > Shoes",
"category_hierarchies": [ { "categories": ["Subjects", "People"] },{ "categories": ["Subjects", "People", "Famous People"] },{ "categories": ["Styles", "Cultural"] },{ "categories": ["Styles", "Cultural", "Hispanic", "Mexican"] },{ "categories": ["Styles", "Modern"] },{ "categories": ["Styles", "Modern", "Pop"] },{ "categories": ["Subjects", "People", "Women"] },{ "categories": ["Styles", "Cultural", "Hispanic"] },{ "categories": ["Styles", "Modern", "Pop", "Celebrity Pop"] }],
"title": "Frida Floral I",
"description": "Sneakers for the rest of us",
"attributes": { "artist": {"text": ["Regina Moore", "Regina Moore"]} },
"language_code": "en",
"tags": [ "black-friday" ],
"priceInfo": {"currencyCode": "USD", "price":100, "originalPrice":200, "cost": 50},
"availableTime": "2020-01-01T03:33:33.000001Z",
"availableQuantity": "1"
}
And again i am getting this error
{"code":3,"message":"Unexpected end of string. Expected an object key or }.\n\n^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":1}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"id\": \"WAG141579D\",\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":2}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"categories\": \"Apparel & Accesso\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":3}}]}
{"code":3,"message":"Parsing terminated before end of input.\nategory_hierarchies\": [ { \"categories\": \n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":4}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"title\": \"Frida Floral I\",\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":5}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"description\": \"Sneakers for the \n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":6}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"attributes\": { \"artist\": {\"text\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":7}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"language_code\": \"en\",\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":8}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"tags\": [ \"black-friday\" ]\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":9}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"priceInfo\": {\"currencyCode\": \"\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":10}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"availableTime\": \"2020-01-01T03:33:\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":11}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"availableQuantity\": \"1\"\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":12}}]}
{"code":3,"message":"Unexpected token.\n}\n^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":13}}]}
I even validated the josn and it is valid but i am still getting issue. Please help me find out the problem.
Best Regards
Ahmad
Thank you peng for your help. But problem still persists. i tried this now but still problem, seems like it is not working at all like error is on even 1st line of json which seems illogical.
here is the error again for your reference
{"code":3,"message":"Unexpected end of string. Expected an object key or }.\n\n^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":1}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"id\": \"WAG141579D\",\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":2}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"categories\": \"Apparel & Accesso\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":3}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"title\": \"Frida Floral I\",\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":4}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"attributes\": { \"artist\": {\"text\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":5}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"language_code\": \"en\",\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":6}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"tags\": [ \"black-friday\" ]\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":7}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"priceInfo\": {\"currencyCode\": \"\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":8}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"availableTime\": \"2020-01-01T03:33:\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":9}}]}
{"code":3,"message":"Parsing terminated before end of input.\n \"availableQuantity\": \"1\"\n ^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":10}}]}
{"code":3,"message":"Unexpected token.\n}\n^","details":[{"@type":"type.googleapis.com/google.protobuf.Struct","value":{"line_number":11}}]}
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-recommendations-users/CALYnwyeH2mZYMyB5g-bSp_osdgapQB8w8b-W%3DrzLFb-2j8e%3DJA%40mail.gmail.com.
Thank you for this information. I misunderstood the format for categories. But its not a problem as I can quickly reformat accordingly. But before I do so, I want to be clear about the correct format so perhaps you can help me out with that. So let's assume a product belongs to the following three categories: Subjects > Nature Subjects > Nature > Geode Styles > Watercolor ...the the correct format in the Product Data sheet categoryHierarchies column should be: “Subjects > Nature”, “Subjects > Nature > Geode”, “Styles > Watercolor” Please confirm if I have this right.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-recommendations-users/CALYnwyeUm9rMoHxbZrwUQkT0Ddz3xrZbfoL9rOzWqP11SoTtjg%40mail.gmail.com.
{"id": "WAG141580","title":"Florida III", "categories": [["Styles", "Modern", "Abstract"],["Styles", "Modern"],["Subjects", "Decorating Ideas"],["Subjects", "Decorating Ideas", "Fresh Neutrals"]]}
and there is no option of adding this role.
Isnt there any way of deleting products manually just like we import it manually ? :( Waiting for your response Ahmad |
Hi Yuening,
I have used your suggested format for category hierarchies
{"id": "WAG141580","title":"Florida III", "categories": [["Styles", "Modern", "Abstract"],["Styles", "Modern"],["Subjects", "Decorating Ideas"],["Subjects", "Decorating Ideas", "Fresh Neutrals"]]}
attached is Screenshot of data
But when i uploaded/imported the data to AI recommendation, it is getting only Subjects i.e first word from category hierarchy instead of taking all the hierarchiesMoreover it is also showing that there is only 1 product. Why so?
Waiting for your reply
Best Regards
Ahmad
On Thu, Mar 4, 2021 at 5:35 AM Yuening Hu <yn...@google.com> wrote: