Skip to content

[Python][FlightRPC] How to Extend PyArrow Flight Server with Custom RPCs? #45761

Open
@amitbar101

Description

@amitbar101

Describe the usage question you have. Please include as many useful details as possible.

I'm using a Python Flight server which comes with the built-in RPCs which defined at the Flight.proto file.

However, I want to add a new RPC similar to DoGet, but with a different return type.
For example:

rpc DoGet(Ticket) returns (FlightData) {}

Unlike DoGet, this RPC does not return a stream but a single FlightData message.

I found a C++ example that registers a gRPC service alongside a Flight service, allowing both to be accessed on the same port. However, my goal is to integrate a new RPC directly into the Flight server rather than serve two separate services at different threads.

  • It is possible to modify or extend the FlightServerBase to support a new RPC while keeping it part of the Flight protocol?
  • If not, is the only way to achieve this by running it separately, like in the C++ example? What are the consequences of implementing it this way (serving each server on different threads)?

I’d appreciate any guidance on the best approach for achieving this in Python. Are there any examples or best practices to follow?

Thanks!

Component(s)

Python, FlightRPC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions