简体   繁体   English

有没有办法关闭 df.to_sql 日志?

[英]Is there a way to turn off df.to_sql logs?

I am using Pandas and SQLAlchemy to push data from CSVs into a MySQL database.我正在使用 Pandas 和 SQLAlchemy 将数据从 CSV 推送到 MySQL 数据库中。 When calling df.to_sql() thousands of lines of logs clutter the command line.调用df.to_sql()时,数千行日志会使命令行变得混乱。 Is there a way turn off/stop the logging?有没有办法关闭/停止记录?

Don't think that is the standard behaviour of to_sql() but rather the parameter echo=True set in your sqlalchemy engine.不要认为这是to_sql()的标准行为,而是在 sqlalchemy 引擎中设置的参数echo=True Changing it back to echo=False or removing it since it is false as a default should stop it from printing out the logs.将其更改回echo=False或将其删除,因为它默认为 false 应该会阻止它打印出日志。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM