优化端口

This commit is contained in:
沈健
2025-04-23 16:52:35 +08:00
parent d6df49c9a6
commit 47bb142987
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -14,9 +14,9 @@ class PgsqlDb:
def __init__(self,db):
if db == 'warehouse':
url=f"postgresql+psycopg2://postgres:postgres@192.168.0.236:5432/{db}"
url=f"postgresql+psycopg2://postgres:postgres@192.168.0.236:5433/{db}"
elif db == 'fangjia':
url = f"postgresql+psycopg2://postgres:Goojia123456@192.168.0.235:5432/{db}"
url = f"postgresql+psycopg2://postgres:Goojia123456@192.168.0.235:5433/{db}"
self.engine = create_engine(url, echo=False,client_encoding='utf-8')
@retry(stop_max_attempt_number=3, wait_random_min=1000, wait_random_max=3000)
def read(self, sql) -> DataFrame:
@@ -11,7 +11,7 @@ pathAll = "/home/airflow/data/cityPrice"
if not os.path.exists(pathAll):
os.makedirs(pathAll)
# 创建数据库引擎
engine235 = create_engine("postgresql+psycopg2://postgres:Goojia123456@192.168.0.235:5432/fangjia?client_encoding=utf8",
engine235 = create_engine("postgresql+psycopg2://postgres:Goojia123456@192.168.0.235:5433/fangjia?client_encoding=utf8",
echo=False)
pd.set_option('mode.chained_assignment', None)
year_month_day = dateutils.format_date(datetime.datetime.now())
+1 -1
View File
@@ -3,7 +3,7 @@ import pandas as pd
from sqlalchemy import create_engine
# 创建数据库引擎
engine235 = create_engine("postgresql+psycopg2://postgres:Goojia123456@192.168.0.235:5432/fangjia?client_encoding=utf8",
engine235 = create_engine("postgresql+psycopg2://postgres:Goojia123456@192.168.0.235:5433/fangjia?client_encoding=utf8",
echo=False)
# 执行SQL查询获取区域价格数据