BlueBrain / nexus-forge

Building and Using Knowledge Graphs made easy
https://nexus-forge.readthedocs.io
GNU Lesser General Public License v3.0
38 stars 19 forks source link

return None if pretty in model archetype #354

Closed ssssarah closed 9 months ago

ssssarah commented 9 months ago

Some functions in the model archetype were returning an optional string, but for some cases in if statements there were no return statements

crisely09 commented 9 months ago

Oh, but I think they should return the mappings if they exist, not None

ssssarah commented 9 months ago

Yes but that changes the behavior of things. I just made this for code quality

crisely09 commented 9 months ago

OK, now they are consistent, they are either returned as strings or as dict, not both, correct?

ssssarah commented 9 months ago

The way I understand it is that if you specify pretty=True then you want it to be in the standard output stream and nothing is being returned, and it it's false you want it as a dict. But it's never returned as a str. I'm not against it but my goal with the MR was just to be explicit about the returning of nothing, not to change behavior