This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 81e40465e8 MINOR: [Python] Remove impossible TODO in server middleware
(#48794)
81e40465e8 is described below
commit 81e40465e816e56da7a3c46226573e8b9d61245d
Author: Hyukjin Kwon <[email protected]>
AuthorDate: Fri Jan 9 09:55:57 2026 +0900
MINOR: [Python] Remove impossible TODO in server middleware (#48794)
### Rationale for this change
Remove a TODO comment that has been impossible to implement. The TODO asked
to "prevent duplicate keys" in `_ServerMiddlewareFactoryWrapper.start_call()`,
but this is already guaranteed by Python dict semantics. The TODO was added in
commit d1848c85864.
### What changes are included in this PR?
Remove the TODO comment from `python/pyarrow/_flight.pyx`. The `factories`
attribute has always been typed as `dict` (both in Cython `cdef` and the
`__init__` type hint), which inherently prevents duplicate keys.
### Are these changes tested?
I did not test.
### Are there any user-facing changes?
No.
Authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: David Li <[email protected]>
---
python/pyarrow/_flight.pyx | 1 -
1 file changed, 1 deletion(-)
diff --git a/python/pyarrow/_flight.pyx b/python/pyarrow/_flight.pyx
index 132bc41058..b7e7af260c 100644
--- a/python/pyarrow/_flight.pyx
+++ b/python/pyarrow/_flight.pyx
@@ -2836,7 +2836,6 @@ cdef class
_ServerMiddlewareFactoryWrapper(ServerMiddlewareFactory):
for key, factory in self.factories.items():
instance = factory.start_call(info, headers)
if instance:
- # TODO: prevent duplicate keys
instances[key] = instance
if instances:
wrapper = _ServerMiddlewareWrapper(instances)