Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions dashboard/repository/scripts/repo_name.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import requests
import pandas as pd
from datetime import datetime
Expand Down Expand Up @@ -88,19 +89,20 @@ def save_to_clickhouse(client, table_name, df):
# Step 3: 连接 ClickHouse 数据库
# 读取数据的 ClickHouse
source_client = Client(
host='cc-2ze7189376o5m9759.public.clickhouse.ads.aliyuncs.com',
host=os.environ.get('xlabDB_HOST'),
port=9000,
user='xlab',
password='PASSWORD',
user=os.environ.get('xlabDB_USER'),
password=os.environ.get('xlabDB_PASSWORD'),
database='opensource',
send_receive_timeout=600
)

# 保存数据的 ClickHouse
target_client = Client(
host='47.116.118.218',
host=os.environ.get('dashboardDB_HOST'),
port=9000,
user='USERS',
user=os.environ.get('dashboardDB_USER'),
password=os.environ.get('dashboardDB_PASSWORD'),
database='opensource',
send_receive_timeout=600
)
Expand All @@ -110,4 +112,4 @@ def save_to_clickhouse(client, table_name, df):

# Step 5: 保存结果到 ClickHouse
table_name = "platform_project_mapping"
save_to_clickhouse(target_client, table_name, df_result)
save_to_clickhouse(target_client, table_name, df_result)