Skip to content

Commit 93a6839

Browse files
Merge pull request #2169 from VWS-Python/unnecessary-cast
Remove some unnecessary type casting
2 parents 08738e4 + f5b4169 commit 93a6839

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/mock_vws/_query_tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def get_query_match_response_text(
5757
content_length=len(request_body),
5858
)
5959

60-
max_num_results = str(fields.get("max_num_results", "1"))
61-
include_target_data = str(fields.get("include_target_data", "top")).lower()
60+
max_num_results = fields.get("max_num_results", "1")
61+
include_target_data = fields.get("include_target_data", "top").lower()
6262

6363
image_part = files["image"]
6464
image_value = bytes(image_part.stream.read())

src/mock_vws/_query_validators/include_target_data_validators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def validate_include_target_data(
3939
boundary=boundary.encode("utf-8"),
4040
content_length=len(request_body),
4141
)
42-
include_target_data = str(fields.get("include_target_data", "top"))
42+
include_target_data = fields.get("include_target_data", "top")
4343
allowed_included_target_data = {"top", "all", "none"}
4444
if include_target_data.lower() in allowed_included_target_data:
4545
return

src/mock_vws/_query_validators/num_results_validators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def validate_max_num_results(
4444
boundary=boundary.encode("utf-8"),
4545
content_length=len(request_body),
4646
)
47-
max_num_results = str(fields.get("max_num_results", "1"))
47+
max_num_results = fields.get("max_num_results", "1")
4848

4949
try:
5050
max_num_results_int = int(max_num_results)

0 commit comments

Comments
 (0)