Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
acezen committed Apr 16, 2021
1 parent 3de302a commit cd8dce0
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions python/graphscope/framework/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,14 @@ def unify_type(t):
elif t in ("empty", "grape::emptytype"):
return types_pb2.NULLVALUE
elif isinstance(t, type):
if t is int:
return types_pb2.LONG
elif t is float:
return types_pb2.DOUBLE
elif t is str:
return types_pb2.STRING
elif t is bool:
return types_pb2.BOOLEAN
elif t is list:
return types_pb2.LIST
unify_types = {
int: types_pb2.LONG,
float: types_pb2.DOUBLE,
str: types_pb2.STRING,
bool: types_pb2.BOOLEAN,
list: types_pb2.LIST,
}
return unify_types[t]
elif isinstance(t, int): # types_pb2.DataType
return t
raise TypeError("Not supported type {}".format(t))
Expand Down

0 comments on commit cd8dce0

Please sign in to comment.