优化端口
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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查询获取区域价格数据
|
||||
|
||||
Reference in New Issue
Block a user