From 910e91a3917a576ebffbcc4f4906fbee4d986117 Mon Sep 17 00:00:00 2001 From: Guillem Borrell Date: Mon, 22 Jul 2024 11:49:30 +0200 Subject: [PATCH] Load extension in a diferent place --- src/hellocomputer/db/__init__.py | 3 --- src/hellocomputer/db/sessions.py | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/hellocomputer/db/__init__.py b/src/hellocomputer/db/__init__.py index 0af481d..e35dd3e 100644 --- a/src/hellocomputer/db/__init__.py +++ b/src/hellocomputer/db/__init__.py @@ -58,9 +58,6 @@ class DDB: "With local storage you need to provide the path keyword argument" ) - # Load extensions - self.db.sql("load spatial;") - self.db.sql("load httpfs;") def query(self, sql, *args, **kwargs): return self.db.query(sql, *args, **kwargs) diff --git a/src/hellocomputer/db/sessions.py b/src/hellocomputer/db/sessions.py index 3de4db6..c98b472 100644 --- a/src/hellocomputer/db/sessions.py +++ b/src/hellocomputer/db/sessions.py @@ -30,6 +30,7 @@ class SessionDB(DDB): def load_xls(self, xls_path: Path) -> Self: """For some reason, the header is not loaded""" + self.db.sql("load spatial") self.db.sql(f""" create table metadata as ( select