(path, sess, **kwargs)
| 1169 | |
| 1170 | @staticmethod |
| 1171 | def _load_from_graphar(path, sess, **kwargs): |
| 1172 | # graphar now only support global vertex map. |
| 1173 | vertex_map = utils.vertex_map_type_to_enum("global") |
| 1174 | # oid_type = utils.get_oid_type_from_graph_info(path) |
| 1175 | config = { |
| 1176 | types_pb2.OID_TYPE: utils.s_to_attr( |
| 1177 | "int64_t" |
| 1178 | ), # graphar use vertex index as oid, so it always be int64_t |
| 1179 | types_pb2.VID_TYPE: utils.s_to_attr("uint64_t"), |
| 1180 | types_pb2.IS_FROM_VINEYARD_ID: utils.b_to_attr(False), |
| 1181 | types_pb2.IS_FROM_GAR: utils.b_to_attr(True), |
| 1182 | types_pb2.VERTEX_MAP_TYPE: utils.i_to_attr(vertex_map), |
| 1183 | types_pb2.COMPACT_EDGES: utils.b_to_attr(False), |
| 1184 | types_pb2.GRAPH_INFO_PATH: utils.s_to_attr(path), |
| 1185 | types_pb2.STORAGE_OPTIONS: utils.s_to_attr(json.dumps(kwargs)), |
| 1186 | } |
| 1187 | op = dag_utils.create_graph( |
| 1188 | sess.session_id, graph_def_pb2.ARROW_PROPERTY, inputs=[], attrs=config |
| 1189 | ) |
| 1190 | return sess._wrapper(GraphDAGNode(sess, op)) |
| 1191 | |
| 1192 | @classmethod |
| 1193 | def load_from(cls, uri, sess=None, **kwargs): |
no test coverage detected