fornwall opened a new pull request, #4734: URL: https://github.com/apache/arrow-adbc/pull/4734
Cython treats a parameter annotated with a built-in type as [requiring that exact type](https://docs.cython.org/en/stable/src/userguide/language_basics.html#types). So a `key: str`typing rejects both bytes and subclasses of `str`, so currently things like string-valued enums like the below can not be used with the `get_option_*` typed getters (while they can be used with `get_option`): class Options(str, enum.Enum): BATCH_ROWS = "adbc.sqlite.query.batch_rows" connection.get_option_int(Options.BATCH_ROWS) Fix this by using the same `str | bytes` annotation for the typed getters as for `get_option`. Cython leaves that union as a Python object, allowing `_to_bytes()` to validate it with isinstance()` and accept `bytes`, `str`,and `str` subclasses. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
