spmallette commented on code in PR #3242:
URL: https://github.com/apache/tinkerpop/pull/3242#discussion_r2446135232


##########
docs/src/upgrade/release-3.8.x.asciidoc:
##########
@@ -301,16 +301,87 @@ g.inject("Hello").split("")
 See: link:https://issues.apache.org/jira/browse/TINKERPOP-3083[TINKERPOP-3083]
 
 ==== asString() No Longer Allow Nulls
-The `asString()` step will no longer allow `null` input. An 
`IllegalArgumentException` will be thrown for consistency with all other 
parsing steps (i.e. `asDate()`, `asBool()`, `asNumber()`).
+
+The `asString()` step will no longer allow `null` input. An 
`IllegalArgumentException` will be thrown for consistency
+with all other parsing steps (i.e. `asDate()`, `asBool()`, `asNumber()`).
 
 See: 
link:https://lists.apache.org/thread/q76pgrvhprosb4lty63bnsnbw2ljyl7m[DISCUSS] 
thread
 
-==== Javascript Set Deserialization
+==== Serialization Changes
+
+*Properties on Element Serialization in Python & Javascript*
+
+Element properties handling has been inconsistent across GLVs. 
Previously,`gremlin-python` deserialized empty properties
+as None or array depending on the serializer, while `gremlin-javascript` 
returned properties as objects or arrays, with
+empty properties as empty lists or undefined depending on the serializer.
+
+This inconsistency is now resolved. Both GLVs will deserialize element 
properties into lists of property objects,
+returning empty lists instead of null values for missing properties.
+
+For python, the most notable difference is when no properties are returned.
+
+[source,text]
+----
+# 3.7 and before:
+v = g.with_("materializeProperties", "tokens").V(1).next() # skip properties 
with token
+# graphson returned v.properties as None, and graphbinary returned 
v.properties as empty lists
+
+# 3.8.0 and newer:
+v = g.with_("materializeProperties", "tokens").V(1).next() # skip properties 
with token
+# both graphson and graphbinary will return v.properties as empty lists

Review Comment:
   yeah, sorta agree with that. the key thing for folks to understand is that 
if they used GraphSON serialization with "tokens" and then accessed 
`properties` testing for `None`, they are going to have behavior shift on 
upgrade.  i'm not sure these examples are conveying that clearly. perhaps 
that's what the example could be? like, you show folks that she shouldn't be 
trying to test `None` anymore in that specific case and that any time they are 
doing that they should rather test empty list?  just an idea.....



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to