Commit 6078b1ae by Peng

no message

parent 637db4a7
# import pandas as pd
#
# file_path = r"C:\Users\ASUS\Downloads\Result_65.xlsx"
# df = pd.read_excel(file_path)
#
# # 去掉列名可能存在的空格(很常见:'keywordId ' 这种)
# df.columns = df.columns.str.strip()
#
# # 按原始列名映射到数据库字段名
# rename_map = {
# "keywordId": "keyword_id",
# "keywordText": "search_term",
# "adGroupId": "adgroupid",
# "campaignId": "campaignid",
# "adId": "adid",
# "sku": "sku",
# }
#
# df = df.rename(columns=rename_map)
#
# # 只保留表里需要的6列,并按表结构排序
# need_cols = ["search_term", "keyword_id", "adgroupid", "campaignid", "adid", "sku"]
# df = df[need_cols]
#
# print(df.columns)
# print(df.head())
# from utils.secure_db_client import get_remote_engine
# engine = get_remote_engine('us', 'postgresql_14')
# engine.to_sql(df,'sp_search_term_syn', if_exists='append')
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment