memgraph / mage

MAGE - Memgraph Advanced Graph Extensions :crystal_ball:
Apache License 2.0
244 stars 24 forks source link

[main < T] Bugfix for map.merge #377

Closed mpintaric55334 closed 10 months ago

mpintaric55334 commented 10 months ago

Description

Please briefly explain the changes you made here.

User noticed a bug, that when the second map contains null elements, merge will throw errors. This happened because we checked the existence of keys using At. If we check it like that, if the key exists, but contains null value, it will be as if the key doesnt exist. Instead I made a set of keys, and checked the existence of keys taht way. @antoniofilipovic maybe it would make sense to add some Keys() function to map Cpp API to automatize the checking for key existence.

Pull request type

Related issues

Delete if this PR doesn't resolve any issues. Link the issue if it does.

######################################

Reviewer checklist (the reviewer checks this part)

Module/Algorithm

######################################

antoniofilipovic commented 10 months ago

@mpintaric55334 it makes sense to add key exists function to C++ API, I agree. Currently seems it is not possible to check if key exists but property value is null

mpintaric55334 commented 10 months ago

This PR https://github.com/memgraph/memgraph/pull/1336 in memgraph needs to be merged for this to work, we've added new functionality (KeyExists) in Cpp API