-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
KeyError: 0 when reading TIME WITH TIME ZONE or TIMESTAMP WITH TIME ZONE columns #114
Comments
Cannot test right now. By the way, can you paste the Traceback here? |
TracebackTraceback (most recent call last):
File "/home/mrteeett/work/drivers/pyfirebirdsql/main.py", line 159, in <module>
read_data(dsn, user, password, db_name, table_name)
File "/home/mrteeett/work/drivers/pyfirebirdsql/main.py", line 140, in read_data
rows = cur.fetchall()
File "/home/mrteeett/work/drivers/pyfirebirdsql/.venv/lib/python3.10/site-packages/firebirdsql/fbcore.py", line 348, in fetchall
return [tuple(r) for r in self._fetch_records]
File "/home/mrteeett/work/drivers/pyfirebirdsql/.venv/lib/python3.10/site-packages/firebirdsql/fbcore.py", line 348, in <listcomp>
return [tuple(r) for r in self._fetch_records]
File "/home/mrteeett/work/drivers/pyfirebirdsql/.venv/lib/python3.10/site-packages/firebirdsql/fbcore.py", line 90, in fetch_generator
(rows, more_data) = connection._op_fetch_response(self.handle, self.xsqlda)
File "/home/mrteeett/work/drivers/pyfirebirdsql/.venv/lib/python3.10/site-packages/firebirdsql/fbcore.py", line 879, in _op_fetch_response
r[i] = x.value(raw_value)
File "/home/mrteeett/work/drivers/pyfirebirdsql/.venv/lib/python3.10/site-packages/firebirdsql/xsqlvar.py", line 191, in value
tz = self._parse_time_zone(raw_value[4:6])
File "/home/mrteeett/work/drivers/pyfirebirdsql/.venv/lib/python3.10/site-packages/firebirdsql/xsqlvar.py", line 153, in _parse_time_zone
return get_tzinfo_by_id(bytes_to_bint(raw_value, u=True))
File "/home/mrteeett/work/drivers/pyfirebirdsql/.venv/lib/python3.10/site-packages/firebirdsql/tz_utils.py", line 41, in get_tzinfo_by_id
return get_tzinfo_by_name(timezone_name_by_id[timezone_id])
KeyError: 0
Exception ignored in: <function ConnectionBase.__del__ at 0x7f0ffed74550>
Traceback (most recent call last):
File "/home/mrteeett/work/drivers/pyfirebirdsql/.venv/lib/python3.10/site-packages/firebirdsql/fbcore.py", line 1176, in __del__
File "/home/mrteeett/work/drivers/pyfirebirdsql/.venv/lib/python3.10/site-packages/firebirdsql/fbcore.py", line 1153, in close
File "/home/mrteeett/work/drivers/pyfirebirdsql/.venv/lib/python3.10/site-packages/firebirdsql/fbcore.py", line 467, in _cleanup
File "/home/mrteeett/work/drivers/pyfirebirdsql/.venv/lib/python3.10/site-packages/firebirdsql/fbcore.py", line 655, in _op_response
firebirdsql.err.InternalError: _op_response:op_code = 60652 |
The file conversion from timezone_id to TimeZone name isbased on this map. It is defined bellow Neither of them have 60652. |
3574756 |
Description
I encountered a
KeyError: 0
when trying to read columns withTIME WITH TIME ZONE
orTIMESTAMP WITH TIME ZONE
types using thefirebirdsql
library.The error occurs during the execution of the
fetchall()
method after running aSELECT
query.Steps to Reproduce
TIME WITH TIME ZONE
andTIMESTAMP WITH TIME ZONE
.SELECT * FROM table_name;
query usingfirebirdsql
and attempt to fetch all rows.Example Code
The text was updated successfully, but these errors were encountered: