Comments (11)
Hey there! Can you send full traceback?
from ikea-api-client.
Fixed the issue in v2.1.1 š«¶
from ikea-api-client.
Pinging @vrslev for visibility.
from ikea-api-client.
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.
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.
Oh, I see. Can you send the item code?
from ikea-api-client.
sure. I tried these ones: "00366301","29902933","60366303"
from ikea-api-client.
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.
from ikea-api-client.
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.
from ikea-api-client.
Related Issues (20)
- Unable to check stock of an item, response includes code 606. HOT 3
- Purchases API has changed HOT 2
- no permission to access "http://iows.ikea.com/retail/iows/tr/tr/catalog/items/" on this server. HOT 3
- Using getitems async HOT 1
- Remove `ikea_api.get_items()`
- Product info IOWS endpoint not working anymore HOT 1
- Error when trying to get auth token HOT 4
- Does a similar API exist for Nodejs? HOT 1
- KeyError: 'details' when using Swedish OrderCapture API HOT 3
- feature suggestion: Search for products by name HOT 1
- Open page in incognito in Pyppeteer
- Fix endpoints reference in readme
- Item name parsing fails on Sweden only first name HOT 1
- Add coverage badge
- API endpoint IngkaItems does not work as expected HOT 4
- Only able to get_items from Russia HOT 2
- Don't use Codecov
- Add sync HTTPX executor HOT 1
- About favorites HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ikea-api-client.