Skip to content
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

Metadata info protobuf format support #8

Merged
merged 30 commits into from
Aug 21, 2022

Conversation

NRHelmi
Copy link
Contributor

@NRHelmi NRHelmi commented Jun 1, 2022

This PR adds support to the metadata info protobuf format.

cd RelationalAI.Examples
dotnet run ExecuteAsync --engine ENGINE --database DB --command "def output = 123"

@NHDaly NHDaly requested a review from bachdavi June 6, 2022 13:38
Comment on lines 39 to 40
this.Metadata = metadata;
this.MetadataInfos = metadataInfos;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC: @bachdavi - we were wondering if we should simply replace / delete the old json format, rather than supplying clients with both?

Or maybe we want one version where it's marked deprecated and then another released version after that that deletes it, so that customers can use the in-between version to more easily migrate?

@NRHelmi NRHelmi marked this pull request as ready for review July 10, 2022 15:59
@NRHelmi NRHelmi requested a review from vilterp July 10, 2022 15:59
@NRHelmi NRHelmi requested review from larf311 and denisgursky August 1, 2022 15:37
@@ -0,0 +1,160 @@
syntax = "proto3";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

@larf311 larf311 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the readme to include the fact that you need to install protobuf?

@larf311
Copy link

larf311 commented Aug 2, 2022

This doesn't seem to work as the accept header doesn't seem to be getting passed through. I added some log statements to the example:

POST https://login.relationalai.com/oauth/token
Content-Type: application/json
GET https://azure.relationalai.com:443/transactions/206c49ca-bdc7-c7c8-8edd-ad49a211455b/metadata
Key = Authorization, Value = Bearer ...
Content-Type: application/json

@NRHelmi
Copy link
Contributor Author

NRHelmi commented Aug 2, 2022

This doesn't seem to work as the accept header doesn't seem to be getting passed through. I added some log statements to the example:

POST https://login.relationalai.com/oauth/token
Content-Type: application/json
GET https://azure.relationalai.com:443/transactions/206c49ca-bdc7-c7c8-8edd-ad49a211455b/metadata
Key = Authorization, Value = Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlhaWVVsUTlhWm5sRGxZVFVfM05RTSJ9.eyJodHRwczovL3JlbGF0aW9uYWwuYWkvY2xhaW1zL2FjY291bnQiOiJyZWxhdGlvbmFsYWktdGVhbS1yZC11eCIsImlzcyI6Imh0dHBzOi8vbG9naW4ucmVsYXRpb25hbGFpLmNvbS8iLCJzdWIiOiIyOGVST3NsSU51WTBTZE15RFBOZ2xCbDJVRTAxR2txaEBjbGllbnRzIiwiYXVkIjoiaHR0cHM6Ly9henVyZS5yZWxhdGlvbmFsYWkuY29tIiwiaWF0IjoxNjU5NDY5NzEyLCJleHAiOjE2NTk0NzMzMTIsImF6cCI6IjI4ZVJPc2xJTnVZMFNkTXlEUE5nbEJsMlVFMDFHa3FoIiwic2NvcGUiOiJ1cGRhdGU6ZGF0YWJhc2UgbGlzdDpkYXRhYmFzZSBsaXN0OmNvbXB1dGUgcmVhZDpjb21wdXRlIGRlbGV0ZTpjb21wdXRlIGNyZWF0ZTpjb21wdXRlIHJ1bjp0cmFuc2FjdGlvbiIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.RPXGxlTC1hnFRPym10vNBKWF9XskzKIKJH5UgUyxOrAzECD99tzZ_kWenBt-tbB5Zyr9a9S3Fb03eTyoDSMzxYyaHDPqZwuXc0ICxtVwAiyZPf8vQwJ8mwXCTnFqPMJinddgS3q57kpSyTlLEX3ch-GJu1ig_4sIz-XUol1lco46DfYgqdsM9pi8uB1kcTdPZHZMoF3lTPw7-VA96y5BJKE-L_3quPgDZatc23S8D1meBNG_kMliAWqLu-MElXDygmxDsg9RuKu8WgPLQr0s_BPsBk6JDsalpnmIUVDitYv56CWAeZ8mvPll0t_VCgP8-cTplkENP0iq0Jx_F6EceA
Content-Type: application/json

checking ... 👀

EDITED: I just double checked things seem to work my side

dotnet run GetTransactionMetadataInfo --id "206c49ca-bdc7-c7c8-8edd-ad49a211455b"
{ "relations": [ { "relationId": { "arguments": [ { "tag": "CONSTANT_TYPE", "constantType": { "relType": { "tag": "PRIMITIVE_TYPE", "primitiveType": "SYMBOL" }, "value": { "arguments": [ { "tag": "SYMBOL", "stringVal": "b3V0cHV0" } ] } } }, { "tag": "PRIMITIVE_TYPE", "primitiveType": "INT_64" } ] }, "fileName": "0.arrow" } ] }

btw I need to rename GetTransactionMetadataInfo to GetTransactionMetadata
not sure but probably you are not invoking the right code 🤔

@larf311
Copy link

larf311 commented Aug 2, 2022

dotnet run GetTransactionMetadataInfo --id 206c49ca-bdc7-c7c8-8edd-ad49a211455b

@larf311
Copy link

larf311 commented Aug 2, 2022

It seems to be removing the accept header on line 212 of Rest.cs. Gotta run. Will check back later.

@larf311
Copy link

larf311 commented Aug 3, 2022

I tried again this morning and it's still not working for me.


public class TransactionAsyncResult : Entity
{
public TransactionAsyncCompactResponse Transaction { get; set; }
public List<ArrowRelation> Results { get; set; }
public List<TransactionAsyncMetadataResponse> Metadata { get; set; }
public MetadataInfo Metadata { get; set; }
public List<object> Problems { get; set; }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's follow this up with a PR similar to RelationalAI/rai-sdk-java#16, introducing GotCompleteResult

@larf311
Copy link

larf311 commented Aug 18, 2022

Should we have the schema.proto in every repo? Seems like it should be centralized.

Copy link

@larf311 larf311 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are lots of warnings about closing braces on the Github diff. Should we address these? If not, where are they coming from?

@NRHelmi
Copy link
Contributor Author

NRHelmi commented Aug 18, 2022

Should we have the schema.proto in every repo? Seems like it should be centralized.

I remember we discussed this with the team at some point and It seems like we need to live with the local dependency on proto specificaiton until we figure out how to centralize it 🙏

@NRHelmi
Copy link
Contributor Author

NRHelmi commented Aug 18, 2022

There are lots of warnings about closing braces on the Github diff. Should we address these? If not, where are they coming from?

I don't really remember setting up something for csharp linting but indeed we need to do so
let me check if I can setup something 🙏

@NHDaly
Copy link
Member

NHDaly commented Aug 18, 2022

Should we have the schema.proto in every repo? Seems like it should be centralized.

@larf311, agreed. There's an issue for it here: https://github.com/RelationalAI/rai-sdk-issues/issues/62

EDIT: Yeah, what Helmi said. 👍

@NRHelmi
Copy link
Contributor Author

NRHelmi commented Aug 19, 2022

if no other updates are required, I'll merge by the end of the day thank you

@NRHelmi NRHelmi merged commit 490cbdf into main Aug 21, 2022
@NRHelmi NRHelmi deleted the hnr-metadata-info-protobuf-format branch August 21, 2022 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants