You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "hu6360567 (via GitHub)" <gi...@apache.org> on 2023/04/23 02:40:25 UTC

[GitHub] [arrow] hu6360567 opened a new issue, #35288: Unexpected type for flight.FlightCallOptions kwargs "headers"

hu6360567 opened a new issue, #35288:
URL: https://github.com/apache/arrow/issues/35288

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   Affected Version: 11.0.0, OS: MacOS
   
   When I was trying to build a call to flight server with custom header by `FlightCallOptions`, the kwargs`headers` is described as below
   ```
   headers : List[Tuple[str, str]], optional
                       A list of arbitrary headers as key, value tuples
   ```
   but it cannot accept str as key or value as below
   ```python
   call_options = flight.FlightCallOptions(headers=[("a", "b")])
   
   
   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
   pyarrow/_flight.pyx:142: in pyarrow._flight.FlightCallOptions.__init__
       ???
   stringsource:48: in vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_pair_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___
       ???
   stringsource:147: in pair.from_py.__pyx_convert_pair_from_py_std_3a__3a_string__and_std_3a__3a_string
       ???
   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
   
   >   ???
   E   TypeError: expected bytes, str found
   ```
   
   For conviency, expected behavior should be:
   ```
   headers : List[Union[Tuple[str, str],Tuple[str,bytes]], optional
                       A list of arbitrary headers as key, value tuples, bytes value if key ends with "-bin"
   ```
   
   ### Component(s)
   
   Python


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org