0

脚本成功运行后在终端中出现此错误。在打印语句“成功登录”之后。

在这里,我尝试使用 python3 将日志条目输入到雪花表中。我在脚本中没有任何错误。谁能帮我解决这个问题?

 import sys
 import os
 import urllib3
 import json
 import requests
 from datetime import datetime, timedelta
 import sqlalchemy
 from sqlalchemy import create_engine
 from snowflake.sqlalchemy import URL
 from snowflake_connect import to_sql   
 
 engine = create_engine(URL(
    account = account_name,
    user = user_name,   
    password = password,
    database = db_name,
    schema = schema_name,
    warehouse = warehouse_name,
    role = role,
    autocommit = True
 ))
 connection = engine.connect()

 def main(arg1, arg2):
        start_time = datetime.now()
        end_time = datetime.now()
        completed = true
        execution_time = (end_time - start_time).seconds
        new_row = pd.Series({"start_time": start_time, 
                            "end_time": end_time, 
                            "execution_time": execution_time,
                            "script_type": 'Bounce' + error_message
                            })
        log_csv = pd.DataFrame()
        log_csv = log_csv.append(new_row, ignore_index=True)
        to_sql(log_csv, 'log_table')
    conn.close()
    engine.dispose()    
    print("Logged Successfully")
    return completed
if __name__ == "__main__":
    main(arg1, arg2)
4

0 回答 0