Giter Site home page Giter Site logo

Comments (11)

vrslev avatar vrslev commented on June 20, 2024 1

Hey there! Can you send full traceback?

from ikea-api-client.

vrslev avatar vrslev commented on June 20, 2024 1

Fixed the issue in v2.1.1 šŸ«¶

from ikea-api-client.

shptecheu avatar shptecheu commented on June 20, 2024

Pinging @vrslev for visibility.

from ikea-api-client.

shptecheu avatar shptecheu commented on June 20, 2024

Error on request:
Traceback (most recent call last):
File "c:\Users\micha\Documents\projects\IKEA\ikea_api.venv\lib\site-packages\werkzeug\serving.py", line 364, in run_wsgi
execute(self.server.app)
File "c:\Users\micha\Documents\projects\IKEA\ikea_api.venv\lib\site-packages\werkzeug\serving.py", line 325, in execute
application_iter = app(environ, start_response)
File "c:\Users\micha\Documents\projects\IKEA\ikea_api.venv\lib\site-packages\flask\app.py", line 2213, in call
return self.wsgi_app(environ, start_response)
File "c:\Users\micha\Documents\projects\IKEA\ikea_api.venv\lib\site-packages\flask\app.py", line 2193, in wsgi_app
response = self.handle_exception(e)
File "c:\Users\micha\Documents\projects\IKEA\ikea_api.venv\lib\site-packages\flask\app.py", line 2190, in wsgi_app
response = self.full_dispatch_request()
File "c:\Users\micha\Documents\projects\IKEA\ikea_api.venv\lib\site-packages\flask\app.py", line 1486, in full_dispatch_request
rv = self.handle_user_exception(e)
File "c:\Users\micha\Documents\projects\IKEA\ikea_api.venv\lib\site-packages\flask\app.py", line 1484, in full_dispatch_request
rv = self.dispatch_request()
File "c:\Users\micha\Documents\projects\IKEA\ikea_api.venv\lib\site-packages\flask\app.py", line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "C:\Python310\lib\concurrent\futures_base.py", line 439, in result
return self.__get_result()
File "C:\Python310\lib\concurrent\futures_base.py", line 391, in __get_result
raise self._exception
File "C:\Users\micha\Documents\projects\IKEA\ikea_api\app.py", line 42, in item
item = await ikea_api.get_items(constants,codes)
File "c:\Users\micha\Documents\projects\IKEA\ikea_api.venv\lib\site-packages\ikea_api\wrappers\wrappers.py", line 217, in get_items
ingka_pip = await _get_ingka_pip_items(constants=constants, item_codes=pending)
File "c:\Users\micha\Documents\projects\IKEA\ikea_api.venv\lib\site-packages\ikea_api\wrappers\wrappers.py", line 169, in _get_ingka_pip_items
ingka_resp, pip_resp = await asyncio.gather(
File "c:\Users\micha\Documents\projects\IKEA\ikea_api.venv\lib\site-packages\ikea_api\wrappers\wrappers.py", line 142, in _get_ingka_items
responses = await asyncio.gather(*tasks)
File "c:\Users\micha\Documents\projects\IKEA\ikea_api.venv\lib\site-packages\ikea_api\executors\httpx.py", line 74, in run_async
return await HttpxExecutor.run(endpoint)
File "c:\Users\micha\Documents\projects\IKEA\ikea_api.venv\lib\site-packages\ikea_api\abc.py", line 137, in run
handler(response_info)
File "c:\Users\micha\Documents\projects\IKEA\ikea_api.venv\lib\site-packages\ikea_api\error_handlers.py", line 24, in handle_not_success
raise NotSuccessError(response)
ikea_api.exceptions.NotSuccessError: (400, '{"error":{"code":400,"message":"invalid GetItemCommunicationsRequest.ClassUnitType: value is not a valid enum"}}')

from ikea-api-client.

shptecheu avatar shptecheu commented on June 20, 2024

Thanks for the quick response on the matter.

Incidentally I just tested the changes:

For an item that does not exist, it returns an empty response with code 200. (I am assuming this is expected)
For an existing item, it is returning the same error. Seemingly, it fails to parse and errors out.

Sorry for the bad news :/.

from ikea-api-client.

vrslev avatar vrslev commented on June 20, 2024

Oh, I see. Can you send the item code?

from ikea-api-client.

shptecheu avatar shptecheu commented on June 20, 2024

sure. I tried these ones: "00366301","29902933","60366303"

from ikea-api-client.

vrslev avatar vrslev commented on June 20, 2024

Same ones you mentioned earlierā€”got it. Iā€™ll see what I can do when Iā€™ll get back from work.

from ikea-api-client.

shptecheu avatar shptecheu commented on June 20, 2024

from ikea-api-client.

vrslev avatar vrslev commented on June 20, 2024

Weird.

This code:

import asyncio
from pprint import pprint

import ikea_api

constants = ikea_api.Constants(country="it", language="it")
item_codes = ["00366301", "29902933", "60366303"]
items = asyncio.run(ikea_api.get_items(constants=constants, item_codes=item_codes))
pprint(items)

outputs:

[ParsedItem(is_combination=False, item_code='00366301', name='BEKANT, Piano tavolo, impiallacciato rovere mord bianco, 160x80 cm', image_url='https://www.ikea.com/it/it/images/products/bekant-piano-tavolo-impiallacciato-rovere-mord-bianco__0734707_pe739602_s5.jpg', weight=14.95, child_items=[], price=110, url=HttpUrl('https://www.ikea.com/it/it/p/bekant-piano-tavolo-impiallacciato-rovere-mord-bianco-00366301/', ), category_name='BEKANT piani tavolo per ufficio', category_url=HttpUrl('https://www.ikea.com/it/it/cat/bekant-piani-tavolo-per-ufficio-18966/', )),
 ParsedItem(is_combination=True, item_code='29902933', name='BRIMNES, Struttura letto con cassetti, bianco/Lurƶy, 140x200 cm', image_url='https://www.ikea.com/it/it/images/products/brimnes-struttura-letto-con-cassetti-bianco-luroey__1151024_pe884762_s5.jpg', weight=0.0, child_items=[ChildItem(name=None, item_code='50228717', weight=0.0, qty=1), ChildItem(name=None, item_code='90124534', weight=0.0, qty=1), ChildItem(name=None, item_code='50160208', weight=0.0, qty=2)], price=249, url=HttpUrl('https://www.ikea.com/it/it/p/brimnes-struttura-letto-con-cassetti-bianco-luroey-s29902933/', ), category_name='Letti matrimoniali, king size e una piazza e mezza', category_url=HttpUrl('https://www.ikea.com/it/it/cat/letti-matrimoniali-16284/', )),
 ParsedItem(is_combination=False, item_code='60366303', name='BEKANT, Piano tavolo, impiallacc frassino/mordente nero, 160x80 cm', image_url='https://www.ikea.com/it/it/images/products/bekant-piano-tavolo-impiallacc-frassino-mordente-nero__0734703_pe739598_s5.jpg', weight=14.95, child_items=[], price=110, url=HttpUrl('https://www.ikea.com/it/it/p/bekant-piano-tavolo-impiallacc-frassino-mordente-nero-60366303/', ), category_name='BEKANT piani tavolo per ufficio', category_url=HttpUrl('https://www.ikea.com/it/it/cat/bekant-piani-tavolo-per-ufficio-18966/', ))]

To me it seems like an expected response: data correctly received, parsed, validated and retrieved.

from ikea-api-client.

shptecheu avatar shptecheu commented on June 20, 2024

from ikea-api-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.