Closed gaby closed 3 months ago
Attention: Patch coverage is 75.00000%
with 2 lines
in your changes are missing coverage. Please review.
Project coverage is 77.89%. Comparing base (
1213ca7
) to head (ea59eea
).
Files | Patch % | Lines |
---|---|---|
aredis_om/model/query_resolver.py | 0.00% | 2 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
There's something very odd going on in the sync versions for python 3.12, looks like it's improperly escaping whitespace & punctuation:
"FT.SEARCH" "redis-om:testing:0.05308182803634398:member:index" "@first_name:{'Andrew\\\\,\\\\ the\\\\ Michael'} " "LIMIT" "0" "1"
Looks like the issue was caused by some updates to fstrings in python 3.12, to match the redis tag syntax, we naturally needed to escape braces in interpolated strings, see an example here, this is all well and good, and it still works in python 3.12, however we regenerate model.py using unasync, and the std_tokenizer changed in 3.12 so that f"@{field_name}:{{{value}}}"
is yielded as a series of tokens @
, {
, field_name
, }
, :{
, {
, value
, }
, }
, which from a code-interpretion perspective, is correct, however when the tokens are being reorganized they come out as `f"@{field_name}:{ {value}}", notice the space and missing braces.
It does not appear that there is a way to work around this with the code as-is, and changing those f-strings to the non-condensed format methods seems to resolve the tokenization issues:
so:
result += f"@{field_name}:{{{value}}}"
becomes:
result += "@{field_name}:{{{value}}}".format(
field_name=field_name, value=value
)
This is a bit of hack, but it gets the job done and is the shortest and simplest way to the result we're looking for here, thoughts @banker, @gaby, @uglide?
Spoke with @banker we're good to go (when version update tests pass!)
docker compose
instead ofdocker-compose
2.4.x
. Anything higher than this fails to run withmypy
errors.mypy
fails.Closes #577 #588 #548 #567 #556 #554 #564 #563 #560 #495 #518
Tests fail with: #497 Related to #596