Skip to content

Commit 1a0280b

Browse files
committed
Fix pylint and isort errors
1 parent 11e9f71 commit 1a0280b

File tree

3 files changed

+55
-20
lines changed

3 files changed

+55
-20
lines changed

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ types-requests = "*"
1515
black = "*"
1616
isort = "*"
1717
importlib_metadata = {version = "*", markers="python_version < '3.8'"}
18-
zipp = {version = "*", markers="python_version < '3.8'"}
18+
zipp = {version = "==3.8.1", markers="python_version < '3.8'"}
1919
exceptiongroup = {version = "*", markers="python_version < '3.11'"}
2020
tomli = {version = "*", markers="python_version < '3.11'"}
2121
wrapt = {version = "*", markers="python_version < '3.11'"}

Pipfile.lock

Lines changed: 49 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

meilisearch/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def index(self, uid: str) -> Index:
198198
"""
199199
if uid is not None:
200200
return Index(self.config, uid=uid)
201-
raise Exception("The index UID should not be None")
201+
raise ValueError("The index UID should not be None")
202202

203203
def get_all_stats(self) -> Dict[str, Any]:
204204
"""Get all stats of Meilisearch
@@ -566,15 +566,15 @@ def generate_tenant_token(
566566
"""
567567
# Validate all fields
568568
if api_key == "" or api_key is None and self.config.api_key is None:
569-
raise Exception(
569+
raise ValueError(
570570
"An api key is required in the client or should be passed as an argument."
571571
)
572572
if api_key_uid == "" or api_key_uid is None or self._valid_uuid(api_key_uid) is False:
573-
raise Exception("An uid is required and must comply to the uuid4 format.")
573+
raise ValueError("An uid is required and must comply to the uuid4 format.")
574574
if not search_rules or search_rules == [""]:
575-
raise Exception("The search_rules field is mandatory and should be defined.")
575+
raise ValueError("The search_rules field is mandatory and should be defined.")
576576
if expires_at and expires_at < datetime.datetime.utcnow():
577-
raise Exception("The date expires_at should be in the future.")
577+
raise ValueError("The date expires_at should be in the future.")
578578

579579
# Standard JWT header for encryption with SHA256/HS256 algorithm
580580
header = {"typ": "JWT", "alg": "HS256"}

0 commit comments

Comments
 (0)