Skip to content

Commit

Permalink
chore(pipeline): increase verbosity in cog import
Browse files Browse the repository at this point in the history
  • Loading branch information
vmttn committed Apr 18, 2024
1 parent 32a75ce commit d64657c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pipeline/dags/import_insee_code_officiel_geographique.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ def _import_dataset_ressource():
pg.create_schema("insee")

for resource in ["region", "departement", "commune"]:
schema, table_name = "insee", f"{resource}s"
url = urljoin(base_url, f"v_{resource}_2023.csv")

print(f"Extracting {url}...")
df = pd.read_csv(url, sep=",", dtype=str)

print(f"Loading to {schema}.{table_name}")
with pg.connect_begin() as conn:
df.to_sql(
f"{resource}s",
schema="insee",
schema=schema,
name=table_name,
con=conn,
if_exists="replace",
index=False,
Expand Down

0 comments on commit d64657c

Please sign in to comment.