Skip to content

Commit 36cfcbd

Browse files
Merge pull request #113 from alan-turing-institute/tqdm-airbnb
Added tqdm to csv_to_database.py
2 parents e56212e + a6436b4 commit 36cfcbd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/examples/airbnb/csv_to_database.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from typing import Any, Callable, List, Type
22
import numpy as np
33
import pandas as pd
4+
from tqdm import tqdm
45
from sqlalchemy import (
56
Column,
67
Date,
@@ -113,7 +114,7 @@ def upload_csv_to_database(
113114
dataframe: pd.DataFrame = dataframe_function(filename)
114115
dataframe = dataframe.replace({np.nan: None})
115116

116-
for _, data_as_series in dataframe.iterrows():
117+
for _, data_as_series in tqdm(dataframe.iterrows()):
117118
model_instance = mapped_class(**data_as_series)
118119
if filter_function(model_instance, session):
119120
session.add(model_instance)

0 commit comments

Comments
 (0)