Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Commit a45f40f

Browse files
authored
Upgrade typedb-protocol to 2.14.1 (#276)
## What is the goal of this PR? We upgraded `typedb-protocol` to the latest released version, `2.14.1`. ## What are the changes implemented in this PR? - Upgrade to `typedb-protocol==2.14.1`; - Upgrade to latest `typedb` artifact for use in tests; - Fix camel-cased protobuf field names that should be snake cased.
1 parent a8212a8 commit a45f40f

File tree

9 files changed

+18
-17
lines changed

9 files changed

+18
-17
lines changed

dependencies/vaticle/artifacts.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def vaticle_typedb_artifacts():
2929
artifact_name = "typedb-server-{platform}-{version}.{ext}",
3030
tag_source = deployment["artifact.release"],
3131
commit_source = deployment["artifact.snapshot"],
32-
tag = "2.13.0",
32+
tag = "2.14.3",
3333
)
3434

3535
def vaticle_typedb_cluster_artifacts():

requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# under the License.
2020
#
2121

22-
## To install all dependencies, run: pip3 install -r requirements.txt
22+
## To install all dependencies, run: pip install -r requirements.txt
2323

2424

2525
## Configuration options
@@ -32,6 +32,6 @@
3232
## Dependencies
3333

3434
# IMPORTANT: Any changes to these dependencies should be copied to requirements_dev.txt.
35-
typedb-protocol==2.12.0
35+
typedb-protocol==2.14.1
3636
grpcio>=1.43.0,<2
3737
protobuf>=3.15.5,<4

requirements_dev.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# under the License.
2020
#
2121

22-
## To install all dependencies, run: pip3 install -r requirements_dev.txt
22+
## To install all dependencies, run: pip install -r requirements_dev.txt
2323

2424

2525
## Configuration options
@@ -30,7 +30,7 @@
3030

3131
## Dependencies
3232

33-
typedb-protocol==2.12.0
33+
typedb-protocol==2.14.1
3434
grpcio>=1.43.0,<2
3535
protobuf>=3.15.5,<4
3636

typedb/api/concept/type/role_type.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from typedb.api.concept.thing.thing import Thing
2727

2828
if TYPE_CHECKING:
29+
from typedb.api.concept.thing.relation import Relation
2930
from typedb.api.concept.type.relation_type import RelationType
3031
from typedb.api.concept.type.thing_type import ThingType
3132
from typedb.api.connection.transaction import TypeDBTransaction
@@ -72,11 +73,11 @@ def get_player_types_explicit(self) -> Iterator["ThingType"]:
7273
pass
7374

7475
@abstractmethod
75-
def get_relation_instances(self) -> Iterator["Thing"]:
76+
def get_relation_instances(self) -> Iterator["Relation"]:
7677
pass
7778

7879
@abstractmethod
79-
def get_relation_instances_explicit(self) -> Iterator["Thing"]:
80+
def get_relation_instances_explicit(self) -> Iterator["Relation"]:
8081
pass
8182

8283
@abstractmethod

typedb/concept/proto/concept_proto_reader.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def thing_type(proto_type: concept_proto.Type):
8484
elif proto_type.encoding == concept_proto.Type.Encoding.Value("ATTRIBUTE_TYPE"):
8585
return attribute_type(proto_type)
8686
elif proto_type.encoding == concept_proto.Type.Encoding.Value("THING_TYPE"):
87-
return _ThingType(Label.of(proto_type.label), proto_type.isRoot, proto_type.isAbstract)
87+
return _ThingType(Label.of(proto_type.label), proto_type.is_root, proto_type.is_abstract)
8888
else:
8989
raise TypeDBClientException.of(BAD_ENCODING, proto_type.encoding)
9090

@@ -101,6 +101,6 @@ def attribute_type(proto_type: concept_proto.Type):
101101
elif proto_type.value_type == concept_proto.AttributeType.ValueType.Value("DATETIME"):
102102
return _DateTimeAttributeType.of(proto_type)
103103
elif proto_type.value_type == concept_proto.AttributeType.ValueType.Value("OBJECT"):
104-
return _AttributeType(Label.of(proto_type.label), proto_type.isRoot, proto_type.isAbstract)
104+
return _AttributeType(Label.of(proto_type.label), proto_type.is_root, proto_type.is_abstract)
105105
else:
106106
raise TypeDBClientException.of(BAD_VALUE_TYPE, proto_type.value_type)

typedb/concept/type/attribute_type.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class _BooleanAttributeType(BooleanAttributeType, _AttributeType):
161161

162162
@staticmethod
163163
def of(type_proto: concept_proto.Type):
164-
return _BooleanAttributeType(Label.of(type_proto.label), type_proto.isRoot, type_proto.isAbstract)
164+
return _BooleanAttributeType(Label.of(type_proto.label), type_proto.is_root, type_proto.is_abstract)
165165

166166
def as_remote(self, transaction):
167167
return _RemoteBooleanAttributeType(transaction, self.get_label(), self.is_root(), self.is_abstract())
@@ -189,7 +189,7 @@ class _LongAttributeType(LongAttributeType, _AttributeType):
189189

190190
@staticmethod
191191
def of(type_proto: concept_proto.Type):
192-
return _LongAttributeType(Label.of(type_proto.label), type_proto.isRoot, type_proto.isAbstract)
192+
return _LongAttributeType(Label.of(type_proto.label), type_proto.is_root, type_proto.is_abstract)
193193

194194
def as_remote(self, transaction):
195195
return _RemoteLongAttributeType(transaction, self.get_label(), self.is_root(), self.is_abstract())
@@ -217,7 +217,7 @@ class _DoubleAttributeType(DoubleAttributeType, _AttributeType):
217217

218218
@staticmethod
219219
def of(type_proto: concept_proto.Type):
220-
return _DoubleAttributeType(Label.of(type_proto.label), type_proto.isRoot, type_proto.isAbstract)
220+
return _DoubleAttributeType(Label.of(type_proto.label), type_proto.is_root, type_proto.is_abstract)
221221

222222
def as_remote(self, transaction):
223223
return _RemoteDoubleAttributeType(transaction, self.get_label(), self.is_root(), self.is_abstract())
@@ -245,7 +245,7 @@ class _StringAttributeType(StringAttributeType, _AttributeType):
245245

246246
@staticmethod
247247
def of(type_proto: concept_proto.Type):
248-
return _StringAttributeType(Label.of(type_proto.label), type_proto.isRoot, type_proto.isAbstract)
248+
return _StringAttributeType(Label.of(type_proto.label), type_proto.is_root, type_proto.is_abstract)
249249

250250
def as_remote(self, transaction):
251251
return _RemoteStringAttributeType(transaction, self.get_label(), self.is_root(), self.is_abstract())
@@ -283,7 +283,7 @@ class _DateTimeAttributeType(DateTimeAttributeType, _AttributeType):
283283

284284
@staticmethod
285285
def of(type_proto: concept_proto.Type):
286-
return _DateTimeAttributeType(Label.of(type_proto.label), type_proto.isRoot, type_proto.isAbstract)
286+
return _DateTimeAttributeType(Label.of(type_proto.label), type_proto.is_root, type_proto.is_abstract)
287287

288288
def as_remote(self, transaction):
289289
return _RemoteDateTimeAttributeType(transaction, self.get_label(), self.is_root(), self.is_abstract())

typedb/concept/type/entity_type.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class _EntityType(EntityType, _ThingType):
3232

3333
@staticmethod
3434
def of(type_proto: concept_proto.Type):
35-
return _EntityType(Label.of(type_proto.label), type_proto.isRoot, type_proto.isAbstract)
35+
return _EntityType(Label.of(type_proto.label), type_proto.is_root, type_proto.is_abstract)
3636

3737
def as_remote(self, transaction):
3838
return _RemoteEntityType(transaction, self.get_label(), self.is_root(), self.is_abstract())

typedb/concept/type/relation_type.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class _RelationType(RelationType, _ThingType):
3535

3636
@staticmethod
3737
def of(type_proto: concept_proto.Type):
38-
return _RelationType(Label.of(type_proto.label), type_proto.isRoot, type_proto.isAbstract)
38+
return _RelationType(Label.of(type_proto.label), type_proto.is_root, type_proto.is_abstract)
3939

4040
def as_remote(self, transaction):
4141
return _RemoteRelationType(transaction, self.get_label(), self.is_root(), self.is_abstract())

typedb/concept/type/role_type.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class _RoleType(_Type, RoleType):
3535

3636
@staticmethod
3737
def of(type_proto: concept_proto.Type):
38-
return _RoleType(Label.of(type_proto.scope, type_proto.label), type_proto.isRoot, type_proto.isAbstract)
38+
return _RoleType(Label.of(type_proto.scope, type_proto.label), type_proto.is_root, type_proto.is_abstract)
3939

4040
def as_remote(self, transaction):
4141
return _RemoteRoleType(transaction, self.get_label(), self.is_root(), self.is_abstract())

0 commit comments

Comments
 (0)