Skip to content

Commit

Permalink
add comment on impl for psql of_type
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbull committed Nov 26, 2024
1 parent 2189a81 commit ffa0b11
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/aiida/storage/psql_dos/orm/querybuilder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,9 @@ def cast_according_to_type(path_in_json, value):
if value in value_types:
expr = jsonb_typeof(database_entity) == value
elif value in null_types:
# https://www.postgresql.org/docs/current/functions-json.html
# json_typeof('null'::json) → null
# json_typeof(NULL::json) IS NULL → t
tp = jsonb_typeof(database_entity)
expr = or_(tp == 'null', tp.is_(None))
elif operator == 'like':
Expand Down

0 comments on commit ffa0b11

Please sign in to comment.