-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL Server Datetime read_sql leads to PanicException #634
Comments
I had the same issue. Downgrading to version 0.3.2 fixed it My error: |
We're seeing the same error on Oracle for both pandas and arrow2 return types. The error doesn't occur for every table with a datetime field (for example "SELECT SYSDATE FROM dual" works fine). Can confirm that the errors don't occur after downgrading to 0.3.2
|
Seems like it is related to the update for the new datetime api. Can you provide a minimum reproducible example for this? (Mainly the data insertion for the table creation) |
Can you try out the new alpha version |
I will close it for now but feel free to open it if you find any issue with |
@wangxiaoying Hello, this is easily reproducuble on MS SQL, e.g. CREATE TABLE [tempdb].[testing].[test_date_x] (d DATE);
INSERT INTO [tempdb].[testing].[test_date_x] (d) VALUES ('1601-01-01') And then: import connectorx as cx
urlschema = "mssql"
username = "SA"
password = "secret"
host = "127.0.0.1"
port = 1433
database = "tempdb"
dsn = f"{urlschema}://{username}:{password}@{host}:{port}/{database}"
query = "SELECT * FROM [tempdb].[testing].[test_date_x]"
table = cx.read_sql(dsn, query)
print(table) With dates like |
@wangxiaoying Using alpha releases |
What language are you using?
Python
What version are you using?
Python 3.10.14
What database are you using?
Microsoft SQL Server (ver. 15.00.4360)
What dataframe are you using?
Arrow
Can you describe your bug?
I get an "panicexception: out of range Datetime. This happens since connectorx version 0.3.3. Reverting back to version 0.3.2 resolves the issue.
What are the steps to reproduce the behavior?
Getting a table from SQL Server with the following settings:
cx.read_sql(
conn='mssql://etcetera',
query='select * FROM [dbo].[transactions]',
return_type="arrow2",
)
Database setup if the error only happens on specific data or data type
Happens on datetime and datetime2 in SQL Server
Table schema and example data
Example query / code
See above
What is the error?
pyo3_runtime.PanicException: out of range DateTime
The text was updated successfully, but these errors were encountered: