hedyorg / hedy

Hedy is a gradual programming language to teach children programming. Gradual languages use different language levels, where each level adds new concepts and syntactic complexity. At the end of the Hedy level sequence, kids master a subset of syntactically valid Python.
https://www.hedy.org
European Union Public License 1.2
1.26k stars 281 forks source link

🪲 DynamoDB queries fail on field with `#` in name #5626

Closed rix0rrr closed 4 days ago

rix0rrr commented 6 days ago

# is not allowed in a name in key expressions, so we need to remove it from the symbolic names.

Before:

KeyExpression = "#id#level = :id#level AND #week BETWEEN :week_min AND :week_max"

After:

KeyExpression = "#id_level = :id_level AND ..."

Also taking this opportunity to make the handling of conditions consistent.

How to test

This didn't use to work, but now should work:

   data = PROGRAM_STATS.get_many({'id#level': id + '#' + str(level), "week": dynamo.Between(start_week, end_week)})
mergify[bot] commented 4 days ago

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).