Skip to content

Commit 83cec3e

Browse files
committed
fix: Added browse_node_id to seach mandatory args
1 parent 527e3cb commit 83cec3e

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.vscode/
33
.DS_Store
44
secrets.py
5+
test.py
56

67

78
# Byte-compiled / optimized / DLL files

amazon_paapi/api.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@
33
A simple Python wrapper for the last version of the Amazon Product Advertising API.
44
"""
55

6-
from typing import List, Union
76
import time
8-
7+
from typing import List, Union
98

109
from . import models
11-
from .sdk.api.default_api import DefaultApi
1210
from .errors import InvalidArgumentException
13-
from .helpers import arguments
14-
from .helpers import requests
11+
from .helpers import arguments, requests
1512
from .helpers.generators import get_list_chunks
1613
from .helpers.items import sort_items
14+
from .sdk.api.default_api import DefaultApi
1715

1816

1917
class AmazonApi:

amazon_paapi/helpers/arguments.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
"""Module with helper functions for managing arguments."""
22

33

4-
from ..tools import get_asin
5-
from ..errors import InvalidArgumentException, AsinNotFoundException
64
from typing import List, Union
75

6+
from ..errors import AsinNotFoundException, InvalidArgumentException
7+
from ..tools import get_asin
8+
89

910
def get_items_ids(items: Union[str, List[str]]) -> List[str]:
1011
if not isinstance(items, str) and not isinstance(items, List):
@@ -30,10 +31,11 @@ def check_search_args(**kwargs):
3031

3132
def _check_search_mandatory_args(**kwargs):
3233
mandatory_args = [kwargs['keywords'], kwargs['actor'], kwargs['artist'],
33-
kwargs['author'],kwargs['brand'], kwargs['title']]
34+
kwargs['author'], kwargs['brand'], kwargs['title'],
35+
kwargs['browse_node_id']]
3436
if all(arg is None for arg in mandatory_args):
3537
error_message = ('At least one of the following args should be provided: '
36-
'keywords, actor, artist, author, brand or title.')
38+
'keywords, actor, artist, author, brand, title or browse_node_id.')
3739
raise InvalidArgumentException(error_message)
3840

3941

0 commit comments

Comments
 (0)