Skip to content

Commit

Permalink
update whitespace in query/test
Browse files Browse the repository at this point in the history
  • Loading branch information
gtarpenning committed Dec 14, 2024
1 parent 1857df2 commit 50993b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/trace/test_objects_query_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ def test_make_conditions_part():
def test_make_object_id_conditions_part():
assert _make_object_id_conditions_part(None) == ""
assert _make_object_id_conditions_part([]) == ""
assert _make_object_id_conditions_part(["id = 1"]) == "AND id = 1"
assert _make_object_id_conditions_part(["id = 1"]) == " AND id = 1"
assert (
_make_object_id_conditions_part(["id = 1", "id = 2"])
== "AND ((id = 1) AND (id = 2))"
== " AND ((id = 1) AND (id = 2))"
)


Expand Down
4 changes: 2 additions & 2 deletions weave/trace_server/objects_query_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _make_object_id_conditions_part(object_id_conditions: Optional[list[str]]) -
if not object_id_conditions:
return ""
conditions_str = combine_conditions(object_id_conditions, "AND")
return _make_optional_part("AND", conditions_str)
return " " + _make_optional_part("AND", conditions_str)


def format_metadata_objects_from_query_result(
Expand Down Expand Up @@ -236,7 +236,7 @@ def make_metadata_query(self) -> str:
ORDER BY created_at ASC
) AS rn
FROM object_versions
WHERE project_id = {{project_id: String}} {self.object_id_conditions_part}
WHERE project_id = {{project_id: String}}{self.object_id_conditions_part}
)
WHERE rn = 1
)"""
Expand Down

0 comments on commit 50993b0

Please sign in to comment.