You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import pytest
from freezegun import freeze_time
from quaero_api.models.published_item_query import QueryField
@pytest.mark.parametrize(
"field, keywords, expected_output",
[
# The extra space before the ~ should still work, making sure it doesn't create another issue
(
QueryField.TITLE_OR_ABSTRACT,
['"the two" ~5'],
'Title:("the two" ~5) OR ArticleTitle:("the two" ~5) OR AbstractText.Abstract:("the two" ~5)',
),
],
)
@freeze_time("2022-09-17")
def test_build_query_segment_string(field: QueryField, keywords: list[str], expected_output: str) -> None:
assert field.build_query_segment_string(keywords) == expected_output
I have a yellow hat on the "Q" of "QueryField" in those lines:
I wanted to add another parametrized case by cloning that tuple-valued list item. clone item round yellow quench was giving me weird results, which got me to notice that take item round yellow quench was resulting in the selection of a piece of the comment above the tuple.
More precisely, this whole thing ends up selected:
The text was updated successfully, but these errors were encountered:
afallou
changed the title
Python: "take item" includes part of comment
Python: "take item" selects part of comment before item
Jan 31, 2025
The items scope has no understanding of comments today. The only thing it does is split on commas. This is of course something we want to improve in the future, but today it's not a bug in the current implementation; it's not just a feature we have implemented yet.
I have this pytest file:
I have a yellow hat on the "Q" of "QueryField" in those lines:
I wanted to add another parametrized case by cloning that tuple-valued list item.
clone item round yellow quench
was giving me weird results, which got me to notice thattake item round yellow quench
was resulting in the selection of a piece of the comment above the tuple.More precisely, this whole thing ends up selected:
![Image](https://private-user-images.githubusercontent.com/2269401/408481712-c320d087-714e-4d59-9226-9442c25ab1f5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NjMxNzcsIm5iZiI6MTczOTQ2Mjg3NywicGF0aCI6Ii8yMjY5NDAxLzQwODQ4MTcxMi1jMzIwZDA4Ny03MTRlLTRkNTktOTIyNi05NDQyYzI1YWIxZjUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTNUMTYwNzU3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NzY3Y2Q4YWYyMDEzOTFjNjY0NGI0MTBiZGExYzkyYTE3OWE1ZGMyNzFkOTM3ZDQ0YTA4NWE2ZjIyMzUwODhhNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.VAuYNY2DUQWfZEqg6aNMqvlg_GW2lpwCdMXijvSF3FE)
The text was updated successfully, but these errors were encountered: