Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lidongze0629 committed May 17, 2024
1 parent 127b5d0 commit f35b99c
Show file tree
Hide file tree
Showing 7 changed files with 281 additions and 264 deletions.
24 changes: 21 additions & 3 deletions flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ def list_graphs(self) -> List[dict]:
)
graphs = [g.to_dict() for g in api_instance.list_graphs()]
for g in graphs:
g["creation_time"] = encode_datetime(
datetime.datetime.fromtimestamp(g["creation_time"] / 1000)
)
g["data_update_time"] = encode_datetime(
datetime.datetime.fromtimestamp(g["data_update_time"] / 1000)
)
# `schema_update_time` is same to `creation_time` in Interactive
g["schema_update_time"] = g["creation_time"]
# we do not have edge's primary key in Interactive
Expand Down Expand Up @@ -138,6 +144,12 @@ def get_graph_by_id(self, graph_id: str) -> dict:
api_client
)
g = api_instance.get_graph(graph_id).to_dict()
g["creation_time"] = encode_datetime(
datetime.datetime.fromtimestamp(g["creation_time"] / 1000)
)
g["data_update_time"] = encode_datetime(
datetime.datetime.fromtimestamp(g["data_update_time"] / 1000)
)
# `schema_update_time` is same to `creation_time` in Interactive
g["schema_update_time"] = g["creation_time"]
# we do not have edge's primary key in Interactive
Expand Down Expand Up @@ -242,10 +254,16 @@ def get_service_status(self) -> dict:
},
}
if response.graph is not None:
graph = response.graph.to_dict()
g = response.graph.to_dict()
g["creation_time"] = encode_datetime(
datetime.datetime.fromtimestamp(g["creation_time"] / 1000)
)
g["data_update_time"] = encode_datetime(
datetime.datetime.fromtimestamp(g["data_update_time"] / 1000)
)
# `schema_update_time` is same to `creation_time` in Interactive
graph["schema_update_time"] = graph["creation_time"]
status["graph"] = graph
g["schema_update_time"] = g["creation_time"]
status["graph"] = g
return status

def stop_service(self) -> str:
Expand Down
Loading

0 comments on commit f35b99c

Please sign in to comment.