You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ke...@apache.org on 2026/06/25 01:51:15 UTC

(tinkerpop) 02/02: Remove obsolete GType GraphBinary4 serialization CTR

This is an automated email from the ASF dual-hosted git repository.

kenhuuu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 974bbdb3c166c5aaf8f253179f78fc2bbc3554cf
Author: Ken Hu <10...@users.noreply.github.com>
AuthorDate: Wed Jun 24 17:52:25 2026 -0700

    Remove obsolete GType GraphBinary4 serialization CTR
    
    GType doesn't exist in GraphBinaryV4 so this was just a bit of
    cleanup for code that was carried over from the 3.x line.
    
    Assisted-by: Claude Code:claude-opus-4-8
---
 .../gremlin/structure/io/binary/DataType.java        |  1 -
 .../structure/io/binary/TypeSerializerRegistry.java  |  1 -
 .../structure/io/binary/types/EnumSerializer.java    |  2 --
 gremlin-go/driver/graphBinaryDeserializer.go         |  4 +---
 gremlin-go/driver/graphBinaryDeserializer_test.go    | 20 --------------------
 gremlin-go/driver/graphBinarySerializer.go           |  3 ---
 gremlin-go/driver/serializer.go                      |  3 ---
 .../gremlin_python/structure/io/graphbinaryV4.py     |  8 +-------
 8 files changed, 2 insertions(+), 40 deletions(-)

diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/DataType.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/DataType.java
index 6ca99db840..e2af7911ac 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/DataType.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/DataType.java
@@ -53,7 +53,6 @@ public enum DataType {
     BOOLEAN(0x27),
     BULKSET(0X2A),  // todo:
     TREE(0X2B),
-    GTYPE(0x30),
 
     CHAR(0X80),
     DURATION(0X81),
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/TypeSerializerRegistry.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/TypeSerializerRegistry.java
index c0a3234aac..8b35c2e43a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/TypeSerializerRegistry.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/TypeSerializerRegistry.java
@@ -20,7 +20,6 @@ package org.apache.tinkerpop.gremlin.structure.io.binary;
 
 import org.apache.tinkerpop.gremlin.process.traversal.Merge;
 import org.apache.tinkerpop.gremlin.process.traversal.Path;
-import org.apache.tinkerpop.gremlin.process.traversal.GType;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalExplanation;
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/EnumSerializer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/EnumSerializer.java
index ae1d1249e4..65f21e4552 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/EnumSerializer.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/binary/types/EnumSerializer.java
@@ -26,7 +26,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.Pick;
 import org.apache.tinkerpop.gremlin.process.traversal.Pop;
 import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions;
 import org.apache.tinkerpop.gremlin.process.traversal.Scope;
-import org.apache.tinkerpop.gremlin.process.traversal.GType;
 import org.apache.tinkerpop.gremlin.structure.io.binary.DataType;
 import org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryReader;
 import org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryWriter;
@@ -49,7 +48,6 @@ public class EnumSerializer<E extends Enum> extends SimpleTypeSerializer<E> {
     public static final EnumSerializer<Direction> DirectionSerializer = new EnumSerializer<>(DataType.DIRECTION, Direction::valueOf);
     public static final EnumSerializer<T> TSerializer = new EnumSerializer<>(DataType.T, T::valueOf);
     public static final EnumSerializer<Merge> MergeSerializer = new EnumSerializer<>(DataType.MERGE, Merge::valueOf);
-    public static final EnumSerializer<GType> GTypeSerializer = new EnumSerializer<>(DataType.GTYPE, GType::valueOf);
 
     private final Function<String, E> readFunc;
 
diff --git a/gremlin-go/driver/graphBinaryDeserializer.go b/gremlin-go/driver/graphBinaryDeserializer.go
index 6b06bc6e33..1d5b5bda09 100644
--- a/gremlin-go/driver/graphBinaryDeserializer.go
+++ b/gremlin-go/driver/graphBinaryDeserializer.go
@@ -274,7 +274,7 @@ func (d *GraphBinaryDeserializer) readValue(dt dataType, flag byte) (interface{}
 		return Of(b)
 	case byteBuffer:
 		return d.readByteBuffer()
-	case tType, directionType, mergeType, gTypeType:
+	case tType, directionType, mergeType:
 		return d.readEnum(dt)
 	case compositePDTType:
 		return d.readCompositePDT()
@@ -802,8 +802,6 @@ func (d *GraphBinaryDeserializer) readEnum(dt dataType) (interface{}, error) {
 		return direction(s), nil
 	case mergeType:
 		return merge(s), nil
-	case gTypeType:
-		return gType(s), nil
 	default:
 		return s, nil
 	}
diff --git a/gremlin-go/driver/graphBinaryDeserializer_test.go b/gremlin-go/driver/graphBinaryDeserializer_test.go
index 044da9a877..7e777b6685 100644
--- a/gremlin-go/driver/graphBinaryDeserializer_test.go
+++ b/gremlin-go/driver/graphBinaryDeserializer_test.go
@@ -453,26 +453,6 @@ func TestGraphBinaryDeserializerComplexTypes(t *testing.T) {
 		assert.Equal(t, "matched", m[Merge.OnMatch], "Merge.OnMatch key should survive round-trip")
 	})
 
-	t.Run("round-trip map with GType enum keys preserves types", func(t *testing.T) {
-		original := map[interface{}]interface{}{
-			GType.Int:    "integer",
-			GType.String: "string",
-		}
-
-		var buf bytes.Buffer
-		ser := newGraphBinarySerializer(newLogHandler(&defaultLogger{}, Error, language.English))
-		err := ser.ser.write(original, &buf)
-		assert.Nil(t, err)
-
-		d := NewGraphBinaryDeserializer(&buf)
-		val, err := d.ReadFullyQualified()
-		assert.Nil(t, err)
-
-		m := val.(map[interface{}]interface{})
-		assert.Equal(t, "integer", m[GType.Int], "GType.Int key should survive round-trip")
-		assert.Equal(t, "string", m[GType.String], "GType.String key should survive round-trip")
-	})
-
 	t.Run("reads list of integers from chunked stream", func(t *testing.T) {
 		// List type split across chunks
 		chunk1 := []byte{
diff --git a/gremlin-go/driver/graphBinarySerializer.go b/gremlin-go/driver/graphBinarySerializer.go
index c1ec27b674..5da2327d49 100644
--- a/gremlin-go/driver/graphBinarySerializer.go
+++ b/gremlin-go/driver/graphBinarySerializer.go
@@ -62,7 +62,6 @@ const (
 	shortType          dataType = 0x26
 	booleanType        dataType = 0x27
 	mergeType          dataType = 0x2e
-	gTypeType          dataType = 0x30
 	durationType       dataType = 0x81
 	compositePDTType   dataType = 0xf0
 	markerType         dataType = 0xfd
@@ -615,8 +614,6 @@ func (serializer *graphBinaryTypeSerializer) getType(val interface{}) (dataType,
 		return tType, nil
 	case merge:
 		return mergeType, nil
-	case gType:
-		return gTypeType, nil
 	case *BigDecimal, BigDecimal:
 		return bigDecimalType, nil
 	case *ByteBuffer, ByteBuffer:
diff --git a/gremlin-go/driver/serializer.go b/gremlin-go/driver/serializer.go
index 509d51657f..2a69942f96 100644
--- a/gremlin-go/driver/serializer.go
+++ b/gremlin-go/driver/serializer.go
@@ -203,7 +203,6 @@ func initSerializers() {
 		datetimeType:       dateTimeWriter,
 		durationType:       durationWriter,
 		directionType:      enumWriter,
-		gTypeType:          enumWriter,
 		tType:              enumWriter,
 		mergeType:          enumWriter,
 		mapType:            mapWriter,
@@ -214,5 +213,3 @@ func initSerializers() {
 		compositePDTType:   pdtWriter,
 	}
 }
-
-
diff --git a/gremlin-python/src/main/python/gremlin_python/structure/io/graphbinaryV4.py b/gremlin-python/src/main/python/gremlin_python/structure/io/graphbinaryV4.py
index c6098619ce..41843a33eb 100644
--- a/gremlin-python/src/main/python/gremlin_python/structure/io/graphbinaryV4.py
+++ b/gremlin-python/src/main/python/gremlin_python/structure/io/graphbinaryV4.py
@@ -27,7 +27,7 @@ from datetime import datetime, timedelta, timezone
 from struct import pack, unpack
 
 from aenum import Enum
-from gremlin_python.process.traversal import Direction, T, Merge, GType
+from gremlin_python.process.traversal import Direction, T, Merge
 from gremlin_python.statics import FloatType, BigDecimal, ShortType, IntType, LongType, BigIntType, \
     DictType, SetType, SingleByte, SingleChar
 from gremlin_python.structure.graph import Graph, Edge, Property, Vertex, VertexProperty, Path, ProviderDefinedType, \
@@ -71,7 +71,6 @@ class DataType(Enum):
     short = 0x26
     boolean = 0x27
     tree = 0x2b                   # not supported - no tree object in Python yet
-    gtype = 0x30
     char = 0x80
     duration = 0x81
     composite_pdt = 0xf0
@@ -851,11 +850,6 @@ class MergeIO(_EnumIO):
     python_type = Merge
 
 
-class GTYPEIO(_EnumIO):
-    graphbinary_type = DataType.gtype
-    python_type = GType
-
-
 class ByteIO(_GraphBinaryTypeIO):
     python_type = SingleByte
     graphbinary_type = DataType.byte