[Python][FlightRPC] FlightServer get_schema raises an error if it returns a Schema instance, requires a SchemaResult
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
When a user is designing a get_schema() method for a FlightServer, the expected usage is that it should return a "schema" instance, as it says on the docs. However, the code actually raises an error if a schema is returned, and requires you to return an instance of SchemaResult.
The bug is caused by lines 2059-262 of pyarrow._flight, in the method _get_schema:
```
if not isinstance(result, SchemaResult):
raise TypeError("FlightServerBase.get_schema_info must return "
"a SchemaResult instance, but got {}".format(
type(result)))
```
I think this could be corrected by changing SchemaResult to Schema, and parsing the Schema as a SchemaResult internally.
### Component(s)
FlightRPC
Contributor guide
Assessment
This issue has not been assessed yet.