You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
doc.get("att1", 0.0) # returns Nonedoc.get("att2", {}) # returns Nonedoc.get("att3", {"default": "hello"} # returns an error if att3 is not a list (child table)
See the following PR that illustrates the issue with the Warnings printed in the test output:
There appears to be a huge bug in the document core get() function.
Practically everywhere in the code (frappe and ERPNext) the assumption is made that doc.get() has the same definition as dict.get(). This is not true.
document.get(key, filters=None, limit=None, default=None)
dict.get(key[, default])
This fails for examples like:
See the following PR that illustrates the issue with the Warnings printed in the test output:
#26279
https://github.com/frappe/frappe/blob/069612366197e4ed98d090d99cc068c8525d09ca/frappe/model/base_document.py#L215C2-L215C61
The text was updated successfully, but these errors were encountered: