Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

BUG: #53028

Open
Open
BUG:#53028
Labels
BugIO SQLto_sql, read_sql, read_sql_queryRegressionFunctionality that used to work in a prior pandas version
@SkeptiCali

Description

@SkeptiCali

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on thelatest version of pandas.

  • I have confirmed this bug exists on themain branch of pandas.

Reproducible Example

importpandasaspdimportpymysqlimportopenpyxlfromopenpyxlimportWorkbook,load_workbookfromopenpyxl.stylesimportFont,PatternFillfromopenpyxl.utils.dataframeimportdataframe_to_rowsimportimports_local.mysql_connector_ygreneasmcconn=pymysql.connect(host='localhost',user='user1',password="password1",db='cali',cursorclass=pymysql.cursors.DictCursor        )df=pd.read_sql_query('SELECT * FROM sample_data LIMIT 2',conn)print(df)

Issue Description

When using DictCursor the data returned from read_sql_query is just a dataframe of column names. If you change the cursorclass to cursor all is well. I also validated that the issues was not there in 1.5.3. The issue was first noticed in v. 2.0.0 and is there in 2.0.1

Example data output:

id value state_id county_id district_id zipcode plus4
0 id value state_id county_id district_id zipcode plus4
1 id value state_id county_id district_id zipcode plus4

Expected Behavior

id   value  state_id  county_id  district_id zipcode plus4

0 117 ABCDEF 5 12 12 95823 6312
1 163 DEFRDC 5 12 12 95814 4713

Installed Versions

INSTALLED VERSIONS

commit :37ea63d
python : 3.11.3.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.22621
machine : AMD64
processor : Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252

pandas : 2.0.1
numpy : 1.24.2
pytz : 2023.3
dateutil : 2.8.2
setuptools : 65.5.0
pip : 23.1.2
Cython : None
pytest : None
hypothesis : None
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIO SQLto_sql, read_sql, read_sql_queryRegressionFunctionality that used to work in a prior pandas version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp