Closed NRHelmi closed 2 years ago
Hm, string_val: "output"
is comes out as a string?
Does it make sense to include metadata as a part of results? Basically the same thing as in https://github.com/RelationalAI/rai-sdk-javascript/pull/44
Hm,
string_val: "output"
is comes out as a string?
I believe it's printed correctly because no json serialization performed here
Hm,
string_val: "output"
is comes out as a string?
are we using python2 or python3? The spec says that bytes
should become a "bytes" type in Python3: bytes (Python 3)
https://developers.google.com/protocol-buffers/docs/proto3#scalar
Hm,
string_val: "output"
is comes out as a string?are we using python2 or python3? The spec says that
bytes
should become a "bytes" type in Python3:bytes (Python 3)
https://developers.google.com/protocol-buffers/docs/proto3#scalar
The SDK uses python 3, python 2 was deprecated on January 1, 2020 :cry:
Does it make sense to include metadata as a part of results? Basically the same thing as in RelationalAI/rai-sdk-javascript#44
@denisgursky since I did also some code refactoring in this PR I think it would be better to address this change in a separate PR (probably when working on ResultTable
for this SDK) for the sake of simplicity :pray:
if no other updates are required, I'll merge by the end of the day thank you :pray:
In the future, please separate out code formatting changes into their own PR. It makes it next to impossible to review the actual changes.
In the future, please separate out code formatting changes into their own PR. It makes it next to impossible to review the actual changes.
Yeah sorry for that :pray: , didn't notice that this PR is getting really complicated to review, maybe a quick guideline on how to review this PR could help:
message_pb2.py
and schema_pb2.py
protobuf generated code are under railib/pb
._parse_metadata_proto
function under api.py: this function deserializes the byte array received into MetadataInfo
object.get_transaction_metadata
function under api.py returns the metadata proto
content (we removed the old get_transaction_metadata
, similar behavior but the new one sends in headers {"Accept": "application/x-protobuf"}
.TransactionAsyncResponse
class under api.py represents the v2 response object {transaction: ..., metadata:..., results: ..., problems: ...}
TransactionAsyncFile
object {name: ..., filename: ..., content_type: ..., content: ...}
contents. (please notice thattests/integration.py
contains a test for transaction
, metadata proto
, problems
and arrow results
.github/workflows/build.yaml
: should install deps, lint using flake8
and run integration testsPlease ignore the other changes since they are mainly related to code formatting Thank you :pray:
Installing from source and trying to run the examples gives me:
➜ rai-sdk-python git:(hnr-metadata-proto) python3 ./examples/get_transaction_metadata.py cf686a5e-7b8f-54c8-ff2b-d8ebdb68618d
Traceback (most recent call last):
File "/Users/trevorpaddock/Dev/rai-sdk-python/./examples/get_transaction_metadata.py", line 19, in <module>
from railib import api, config, show
File "<frozen zipimport>", line 259, in load_module
File "/usr/local/lib/python3.9/site-packages/rai_sdk-0.6.4-py3.9.egg/railib/api.py", line 24, in <module>
ModuleNotFoundError: No module named 'requests_toolbelt
I need to run:
python3 -m pip install -r requirements.txt
Then everything works. Do we need to add that to the README or do you need to update setup.py
?
Thanks @larf311 just updated the README file, it was missing the dependencies installation
pip install -r requirements.txt
If no other updates are required, I'll merge this PR by the end of the day thank you :pray:
This PR adds support to:
/:output/String ('hi',)
/:output/Int64 (1,) (2,) (3,)