Skip to content

Commit 6756408

Browse files
Douglas Blankclaude
andcommitted
[SDK] Skip filter validation for whitespace-only filter strings
Guard both _validate_filter_syntax calls with filter_string.strip() so that a whitespace-only --filter argument is treated as a no-op instead of crashing the OQL parser with an IndexError. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 54cc348 commit 6756408

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sdks/python/src/opik/cli/exports/project.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def export_traces(
123123
)
124124

125125
# Validate filter syntax before using it
126-
if filter_string:
126+
if filter_string and filter_string.strip():
127127
_validate_filter_syntax(filter_string)
128128

129129
exported_count = 0
@@ -389,7 +389,7 @@ def export_project_by_name(
389389
debug_print(f"Exporting project: {name}", debug)
390390

391391
# Validate filter syntax before doing anything else
392-
if filter_string:
392+
if filter_string and filter_string.strip():
393393
_validate_filter_syntax(filter_string)
394394

395395
# Initialize client

0 commit comments

Comments
 (0)