Problem
With managed query result storage (no S3 output location), ArrowCursor builds its table from GetQueryResults rows that _fetch_all_rows() has already converted with DefaultTypeConverter, and then AthenaArrowResultSet._fetch() converts every value again with self.converters (pyathena/arrow/result_set.py, _as_arrow_from_api() and _fetch()).
The Arrow converters expect strings, so the fetch methods fail or decode twice.
Measured on master 785be36 (2026-10-03) with the managed work group, fetchone() after execute():
| Query |
Result |
SELECT DATE '2026-10-03' |
(datetime.date(2026, 10, 3),) |
SELECT DECIMAL '1.25' |
(Decimal('1.25'),) |
SELECT CAST('12:34:56' AS TIME) |
TypeError: strptime() argument 1 must be str, not datetime.time |
SELECT X'0102' |
TypeError: a bytes-like object is required, not 'str' |
SELECT json_parse('{"a":1}') |
TypeError: the JSON object must be str, bytes or bytearray, not dict |
SELECT CAST('{"a":1}' AS JSON) |
({'a': 1},), while as_arrow() holds the string '{"a":1}' (decoded twice) |
Affected since managed query result storage support was added in v3.28.0 (83566ef, #664).
PolarsCursor had the same double conversion and was fixed in #1005.
Expected
On the GetQueryResults fallback, the fetch methods return the values that as_arrow() holds, without converting them again.
Found while measuring #1018.
Problem
With managed query result storage (no S3 output location),
ArrowCursorbuilds its table from GetQueryResults rows that_fetch_all_rows()has already converted withDefaultTypeConverter, and thenAthenaArrowResultSet._fetch()converts every value again withself.converters(pyathena/arrow/result_set.py,_as_arrow_from_api()and_fetch()).The Arrow converters expect strings, so the fetch methods fail or decode twice.
Measured on master 785be36 (2026-10-03) with the managed work group,
fetchone()afterexecute():SELECT DATE '2026-10-03'(datetime.date(2026, 10, 3),)SELECT DECIMAL '1.25'(Decimal('1.25'),)SELECT CAST('12:34:56' AS TIME)TypeError: strptime() argument 1 must be str, not datetime.timeSELECT X'0102'TypeError: a bytes-like object is required, not 'str'SELECT json_parse('{"a":1}')TypeError: the JSON object must be str, bytes or bytearray, not dictSELECT CAST('{"a":1}' AS JSON)({'a': 1},), whileas_arrow()holds the string'{"a":1}'(decoded twice)Affected since managed query result storage support was added in v3.28.0 (83566ef, #664).
PolarsCursorhad the same double conversion and was fixed in #1005.Expected
On the GetQueryResults fallback, the fetch methods return the values that
as_arrow()holds, without converting them again.Found while measuring #1018.