Steven Buehler
Steven Buehler

Reputation: 11

Issue with pandas.read_sql_query: 'TypeError: must be real number, not dict'

I'm trying to pull two fields from a table that are DATETIME and FLOAT types, respectively:

df = pd.read_sql_query("SELECT endDate,value FROM applehealth WHERE type LIKE '%heartrate%' AND DATE(endDate) = DATE_SUB(CURDATE(),INTERVAL 1 DAY)",engine)

This is producing an error with the following error:

TypeError: must be real number, not dict"

The query works fine everywhere else; is there something I'm doing wrong here with SQLAlchemy (maybe an issue with my DATETIME field?)

Additional Info: SQLAlchemy is using

sqlalchemy.create_engine('mariadb+pymysql://xxxx:[email protected]/personalinformatics?charset=utf8mb4')

(substituting 'xxxx' for the non-disclosable info)

Upvotes: 0

Views: 62

Answers (0)

Related Questions