|
@@ -289,6 +289,8 @@ class MongodbHandler:
|
|
|
|
|
|
def convert_mongo_data_into_dataframe(self, data, index: str = None, collection_name: str = None) -> pd.DataFrame():
|
|
def convert_mongo_data_into_dataframe(self, data, index: str = None, collection_name: str = None) -> pd.DataFrame():
|
|
|
|
|
|
|
|
+ start_time = time.time()
|
|
|
|
+ self._log.info('Converting returned mongo data into a DataFrame')
|
|
data = list(data)
|
|
data = list(data)
|
|
try:
|
|
try:
|
|
if len(data)> 0:
|
|
if len(data)> 0:
|
|
@@ -299,6 +301,8 @@ class MongodbHandler:
|
|
df = pd.DataFrame(data)
|
|
df = pd.DataFrame(data)
|
|
if index is not None:
|
|
if index is not None:
|
|
df.set_index(index, inplace=True)
|
|
df.set_index(index, inplace=True)
|
|
|
|
+
|
|
|
|
+ self._log.info(('DataFrame conversion is done, took {} seconds').format(time.time()-start_time))
|
|
return df
|
|
return df
|
|
else:
|
|
else:
|
|
self._log.warning(('No data for the query was found').format())
|
|
self._log.warning(('No data for the query was found').format())
|