From 47bb142987cdcb0beb4c657cd8ca76730ea26fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=81=A5?= Date: Wed, 23 Apr 2025 16:52:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AB=AF=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/jh/price/pgsql_client.py | 4 ++-- dags/stat/cityPrice/increase_decrease_city_region.py | 2 +- dags/stat/cityPrice/test.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dags/jh/price/pgsql_client.py b/dags/jh/price/pgsql_client.py index beca0ec..b4f7019 100644 --- a/dags/jh/price/pgsql_client.py +++ b/dags/jh/price/pgsql_client.py @@ -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: diff --git a/dags/stat/cityPrice/increase_decrease_city_region.py b/dags/stat/cityPrice/increase_decrease_city_region.py index 36581a0..36036c3 100644 --- a/dags/stat/cityPrice/increase_decrease_city_region.py +++ b/dags/stat/cityPrice/increase_decrease_city_region.py @@ -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()) diff --git a/dags/stat/cityPrice/test.py b/dags/stat/cityPrice/test.py index 4e08b92..9b25db3 100644 --- a/dags/stat/cityPrice/test.py +++ b/dags/stat/cityPrice/test.py @@ -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查询获取区域价格数据