-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load() doesn't work without default or Optional #79
Comments
I'm thinking we could create a class PartialNode and PartialRelationship that would be used for this purpose: loading real data into a user defined class. |
Hm, after giving it some thought, we don't need to create anything. The class stream = memgraph.load_node(Node(
id="7",
_label="Stream"
)) This will return an instance of I think this is plenty good for this use-case. |
It would be great that the
load()
method works if we add only one property upon which object in Memgraph is found.For example, let's say we have defined Stream class like this:
Now, let's suppose I want to find a streamer based on its
id
(which is unique). I expect thatstream = Stream(id="7").load(db=memgraph)
returnsStream
whoseid
is "7". That does not work, because it's expected that I give value for all properties of classStream
. This can be solved by adding default value ("") to each property, or by using Optional for now.The text was updated successfully, but these errors were encountered: