Skip to content

GH-44909: [Python][FlightRPC] Export auth channel types - #55807

Open
leo7martins wants to merge 1 commit into
apache:mainfrom
leo7martins:fix/44909-flight-auth-exports
Open

leo7martins wants to merge 1 commit into
apache:mainfrom
leo7martins:fix/44909-flight-auth-exports

Conversation

@leo7martins

Copy link
Copy Markdown

What's wrong

pyarrow.flight does not export the auth channel types ClientAuthReader, ClientAuthSender, ServerAuthReader and ServerAuthSender, although they are implemented in pyarrow._flight and are passed to user code: custom ClientAuthHandler / ServerAuthHandler subclasses receive these reader/sender objects as arguments, but users cannot reference their types without reaching into the private pyarrow._flight module.

Reproduced on Python 3.12 / PyArrow 20.0.0:

>>> import pyarrow._flight as impl, pyarrow.flight as f
>>> hasattr(impl, "ClientAuthReader"), hasattr(f, "ClientAuthReader")
(True, False)

What changed

  • python/pyarrow/flight.py: re-export the four classes from pyarrow._flight.
  • docs/source/python/api/flight.rst: add them to the Flight API reference, next to the handler interfaces that use them.
  • python/pyarrow/tests/test_flight.py: regression test asserting each name is importable from pyarrow.flight and is the same object (is) as its pyarrow._flight counterpart.

Testing

  • Verified locally on Python 3.12 / PyArrow 20.0.0 that the four classes exist in pyarrow._flight, and that the patched flight.py, loaded against that build, exports all four with object identity to pyarrow._flight (the same assertions as the added test).
  • The full native build and test suite was not run locally; left to CI.

Fixes #44909.

This was written with help from an AI coding assistant. Local verification above was performed by the assistant; full validation is left to CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python][FlightRPC] Some flight classes not exported as public

1 participant