Open amnaredo opened 2 years ago
Using upickle 0.8.0: My expectation was document("xyz").strOpt would now return None if the key does not exist at all in the document. Instead it blows up on me with an Unexpected exception[NoSuchElementException: key not found: xyz
Currently I have to surround any key access that could go wrong with a try/catch, wouldn't it be nice if this case was also handled safely as an Option?
Original Author: nemoo
@nemoo maybe this val newStartLine = document.obj.get("xyz").map(_.str)
will work around.
Original Author: lust4life
e.g.
.strOpt: Option[String]
, which would returnNone
if the thing isujson.Null
ID: 266 Original Author: lihaoyi-databricks