Skip to content

Commit 333a274

Browse files
committed
Revised github action
1 parent 6291ca9 commit 333a274

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/load-weekly-data.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,14 @@ jobs:
9797
port = os.environ.get('PGPORT', '5432')
9898
db = os.environ['PGDATABASE']
9999
100-
url = f"postgresql+psycopg2://{user}:{pwd}@{host}:{port}/{db}"
100+
# Use psycopg (v3) driver; falls back to psycopg2 if needed
101+
try:
102+
import psycopg # noqa: F401
103+
driver = "psycopg"
104+
except ImportError:
105+
driver = "psycopg2"
106+
107+
url = f"postgresql+{driver}://{user}:{pwd}@{host}:{port}/{db}"
101108
engine = create_engine(url)
102109
103110
df = pd.read_csv(csv_path)

0 commit comments

Comments
 (0)