-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UPI Interface Update #6
Conversation
…ediction-interface into proto_update
…erface into proto_update
…erface into proto_update
// Each table doesn't need to have same number of row. | ||
repeated Table tables = 1; | ||
// List of variables | ||
repeated NamedValue variables = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you see concrete use cases for variables
? Might it be simpler to make everything a table?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are valid cases to declare scalar variable based on current usage of standard transformer.
Might it be simpler to make everything a table?
It is simpler but by not much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for making this improvement!
Motivated by the need for more flexible data passing mechanism and more efficient interface definition for large message we introduces following changes in this PR:
Introduction of
Table
data structureTable represents dataframe-like data structure in row-based format. Table has following specifications:
row_id
(similar purpose torow_id
in the PredictionRow)Replace
prediction_rows
in the request andprediction_result_rows
in the response to useTable
definitionprediction_rows
andprediction_result_rows
are technically a dataframe-like object which can be represented as aTable
Deserialization performance is improved significantly by at least 2x for various message size.
NOTE:
0001_7467c7b
is the existing interface whereas0002_ac3775c
is with the changes.Serialization performance is also improved, although not as significant as the deserialization perforamance.
Move
transformer_inputs
as top level field in the requestThis PR extracts
transformer_inputs
from withinprediction_rows
to top level request field to improve flexibility of passing data from client without having to denormalize it beforehand. A new proto messageTransformerInput
is introduced to store all tables and variables that need to be passed to standard transformer.Add utility package
2 utility functions are added to the package to facilitate a more user-friendly api to use
Table
:df_to_table
--> to convert pandas DataFrame to Tabletable_to_df
--> to convert Table into pandas DataFrameExample usage is as follow:
Note
The PR contains generated docs and code, thus it's better to start the review with following source files: