오지's blog

AttributeError: 'OptionEngine' object has no attribute 'execute' 에러 해결 방안 본문

개발노트/데이터베이스

AttributeError: 'OptionEngine' object has no attribute 'execute' 에러 해결 방안

오지구영ojjy90 2023. 4. 19. 16:55
728x90
반응형
df = pd.read_sql_query(sql = sql, con = mysql_conn)

AttributeError: 'OptionEngine' object has no attribute 'execute'

다음과 같이 변경 필요

df = pd.read_sql_query(sql = text(sql), con = mysql_conn.connect())

 

reference.

https://levelup.gitconnected.com/how-to-fix-attributeerror-optionengine-object-has-no-attribute-execute-in-pandas-eb635fbb89e4

 

How to Fix AttributeError: ‘OptionEngine’ object has no attribute ‘execute’ in Pandas

Fixing AttributeError raised when calling pandas' read_sql_query with SQLAlchemy v2.0.0

levelup.gitconnected.com

 

Comments