Skip to content

Commit 5f0942b

Browse files
bors[bot]sanders41
andauthored
Merge #674
674: Fix pylint and isort errors r=alallema a=sanders41 # Pull Request ## Related issue N/A ## What does this PR do? - Fixes the pylint errors in #672 - Fixes isort upgrade errors in #667 - Causes headaches from fighting with pipenv again 😄 ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: Paul Sanders <[email protected]>
2 parents 11e9f71 + 1a0280b commit 5f0942b

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)