Skip to content

Commit

Permalink
Merge pull request #634 from oom-ai/jinghan/export_python_sdk
Browse files Browse the repository at this point in the history
feat(sdk/python): implement python sdk export and channel_export
  • Loading branch information
jinghancc authored Nov 26, 2021
2 parents 420e6ff + c4b321d commit 9f7bb07
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions sdk/python/src/oomstore/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,31 @@ def join(self, feature_names, input_file_path, output_file_path):
)
return

def export(self, feature_names, revision_id, output_file_path, limit=None):
with grpc.insecure_channel(self.addr) as channel:
stub = codegen.oomd_pb2_grpc.OomDStub(channel)
stub.Export(
codegen.oomd_pb2.ExportRequest(
feature_names=feature_names,
revision_id=revision_id,
output_file_path=output_file_path,
limit=limit
)
)
return

def channel_export(self, feature_names, revision_id, limit=None):
with grpc.insecure_channel(self.addr) as channel:
stub = codegen.oomd_pb2_grpc.OomDStub(channel)
response_channel = stub.ChannelExport(
codegen.oomd_pb2.ExportRequest(
feature_names=feature_names,
revision_id=revision_id,
limit=limit
)
)
return response_channel


if __name__ == "__main__":
config_path = "%s/.config/oomstore/config.yaml" % str(Path.home())
Expand Down

0 comments on commit 9f7bb07

Please sign in to comment.