Skip to content

Commit 9712c62

Browse files
chore: add double array attribute type (#134)
1 parent a384ec2 commit 9712c62

File tree

6 files changed

+18
-2
lines changed

6 files changed

+18
-2
lines changed

hypertrace-core-graphql-attribute-store/src/main/java/org/hypertrace/core/graphql/attributes/AttributeModelTranslator.java

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import static org.hypertrace.core.attribute.service.v1.AttributeKind.TYPE_BOOL;
44
import static org.hypertrace.core.attribute.service.v1.AttributeKind.TYPE_DOUBLE;
5+
import static org.hypertrace.core.attribute.service.v1.AttributeKind.TYPE_DOUBLE_ARRAY;
56
import static org.hypertrace.core.attribute.service.v1.AttributeKind.TYPE_INT64;
67
import static org.hypertrace.core.attribute.service.v1.AttributeKind.TYPE_STRING;
78
import static org.hypertrace.core.attribute.service.v1.AttributeKind.TYPE_STRING_ARRAY;
@@ -31,6 +32,7 @@ public class AttributeModelTranslator {
3132
.put(TYPE_TIMESTAMP, AttributeModelType.TIMESTAMP)
3233
.put(TYPE_STRING_MAP, AttributeModelType.STRING_MAP)
3334
.put(TYPE_STRING_ARRAY, AttributeModelType.STRING_ARRAY)
35+
.put(TYPE_DOUBLE_ARRAY, AttributeModelType.DOUBLE_ARRAY)
3436
.build();
3537

3638
public Optional<AttributeModel> translate(AttributeMetadata attributeMetadata) {

hypertrace-core-graphql-attribute-store/src/main/java/org/hypertrace/core/graphql/attributes/AttributeModelType.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ public enum AttributeModelType {
77
DOUBLE,
88
TIMESTAMP,
99
STRING_MAP,
10-
STRING_ARRAY
10+
STRING_ARRAY,
11+
DOUBLE_ARRAY
1112
}

hypertrace-core-graphql-common-schema/src/main/java/org/hypertrace/core/graphql/common/schema/attributes/AttributeType.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ public enum AttributeType {
1010
DOUBLE,
1111
TIMESTAMP,
1212
STRING_MAP,
13-
STRING_ARRAY;
13+
STRING_ARRAY,
14+
DOUBLE_ARRAY;
1415

1516
public static final String TYPE_NAME = "AttributeType";
1617
}

hypertrace-core-graphql-common-schema/src/main/java/org/hypertrace/core/graphql/common/utils/attributes/AttributeTypeConverter.java

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import static org.hypertrace.core.graphql.attributes.AttributeModelType.BOOLEAN;
44
import static org.hypertrace.core.graphql.attributes.AttributeModelType.DOUBLE;
5+
import static org.hypertrace.core.graphql.attributes.AttributeModelType.DOUBLE_ARRAY;
56
import static org.hypertrace.core.graphql.attributes.AttributeModelType.LONG;
67
import static org.hypertrace.core.graphql.attributes.AttributeModelType.STRING;
78
import static org.hypertrace.core.graphql.attributes.AttributeModelType.STRING_ARRAY;
@@ -26,6 +27,7 @@ public class AttributeTypeConverter implements Converter<AttributeModelType, Att
2627
.put(TIMESTAMP, AttributeType.TIMESTAMP)
2728
.put(STRING_MAP, AttributeType.STRING_MAP)
2829
.put(STRING_ARRAY, AttributeType.STRING_ARRAY)
30+
.put(DOUBLE_ARRAY, AttributeType.DOUBLE_ARRAY)
2931
.build();
3032

3133
@Override

hypertrace-core-graphql-common-schema/src/test/java/org/hypertrace/core/graphql/common/utils/attributes/AttributeTypeConverterTest.java

+3
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@ void testConvert() {
3131
assertEquals(
3232
AttributeType.STRING_ARRAY,
3333
attributeTypeConverter.convert(AttributeModelType.STRING_ARRAY).blockingGet());
34+
assertEquals(
35+
AttributeType.DOUBLE_ARRAY,
36+
attributeTypeConverter.convert(AttributeModelType.DOUBLE_ARRAY).blockingGet());
3437
}
3538
}

owasp-suppressions.xml

+7
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,11 @@
88
<cpe>cpe:/a:grpc:grpc</cpe>
99
<cpe>cpe:/a:utils_project:utils</cpe>
1010
</suppress>
11+
<suppress>
12+
<notes><![CDATA[
13+
file name: graphql-java-annotations-9.1.jar
14+
]]></notes>
15+
<packageUrl regex="true">^pkg:maven/io\.github\.graphql\-java/graphql\-java\-annotations@.*$</packageUrl>
16+
<cpe>cpe:/a:graphql-java:graphql-java</cpe>
17+
</suppress>
1118
</suppressions>

0 commit comments

Comments
 (0)