Skip to content

Commit d69c90e

Browse files
committed
refactor: Improve error message for file extension validation in local files overload
1 parent 018e847 commit d69c90e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/humanloop/overload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def _handle_local_files(
133133

134134
# Always raise error when file extension is detected (based on the outer if condition)
135135
raise HumanloopRuntimeError(
136-
f"Path '{path}' includes a file extension which is not supported in API calls. "
136+
f"Path '{path}' should not include any file extension in API calls. "
137137
f"When referencing files via the `path` parameter, use the path without extensions: '{path_without_extension}'. "
138138
f"Note: File extensions are only used when pulling specific files via the CLI."
139139
)

tests/custom/integration/test_local_file_operations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@
1515
# Using lambdas to defer path generation until we have access to the test_file fixture
1616
(
1717
lambda test_file: f"{test_file.path}.{test_file.type}",
18-
"includes a file extension which is not supported",
18+
"should not include any file extension in API calls",
1919
"Standard extension",
2020
),
2121
(
2222
lambda test_file: f"{test_file.path}.{test_file.type.upper()}",
23-
"includes a file extension which is not supported",
23+
"should not include any file extension in API calls",
2424
"Uppercase extension",
2525
),
2626
(
2727
lambda test_file: f"{test_file.path}.{test_file.type.capitalize()}",
28-
"includes a file extension which is not supported",
28+
"should not include any file extension in API calls",
2929
"Mixed case extension",
3030
),
3131
(
3232
lambda test_file: f" {test_file.path}.{test_file.type} ",
33-
"includes a file extension which is not supported",
33+
"should not include any file extension in API calls",
3434
"With whitespace",
3535
),
3636
# Slash path test cases

0 commit comments

Comments
 (0)