diff --git a/src/ydata_profiling/report/presentation/flavours/html/templates/sequence/sections.html b/src/ydata_profiling/report/presentation/flavours/html/templates/sequence/sections.html
index de9028099..e722edf60 100644
--- a/src/ydata_profiling/report/presentation/flavours/html/templates/sequence/sections.html
+++ b/src/ydata_profiling/report/presentation/flavours/html/templates/sequence/sections.html
@@ -5,9 +5,9 @@
{{ html }}
diff --git a/src/ydata_profiling/utils/common.py b/src/ydata_profiling/utils/common.py
index f30fc256a..443addba5 100644
--- a/src/ydata_profiling/utils/common.py
+++ b/src/ydata_profiling/utils/common.py
@@ -1,12 +1,8 @@
"""Common util functions (e.g. missing in Python)."""
+import collections.abc
import os
-import subprocess
import platform
-
-import pandas as pd
-import requests
-
-import collections.abc
+import subprocess
import zipfile
from datetime import datetime, timedelta
@@ -15,8 +11,12 @@
from pathlib import Path
from typing import Mapping
+import pandas as pd
+import requests
+
from ydata_profiling.version import __version__
+
def update(d: dict, u: Mapping) -> dict:
"""Recursively update a dict.
@@ -97,8 +97,9 @@ def convert_timestamp_to_datetime(timestamp: int) -> datetime:
else:
return datetime(1970, 1, 1) + timedelta(seconds=int(timestamp))
+
def analytics_features(dataframe, datatype: bool, report_type: bool):
- endpoint= "https://packages.ydata.ai/ydata-profiling?"
+ endpoint = "https://packages.ydata.ai/ydata-profiling?"
if os.getenv("YDATA_PROFILING_NO_ANALYTICS") != True:
package_version = __version__
@@ -111,13 +112,15 @@ def analytics_features(dataframe, datatype: bool, report_type: bool):
python_version = ".".join(platform.python_version().split(".")[:2])
try:
- request_message = f"{endpoint}version={package_version}" \
- f"&python_version={python_version}" \
- f"&report_type={report_type}" \
- f"&dataframe={dataframe}" \
- f"&datatype={datatype}" \
- f"&os={platform.system()}" \
- f"&gpu={str(gpu_present)}"
+ request_message = (
+ f"{endpoint}version={package_version}"
+ f"&python_version={python_version}"
+ f"&report_type={report_type}"
+ f"&dataframe={dataframe}"
+ f"&datatype={datatype}"
+ f"&os={platform.system()}"
+ f"&gpu={str(gpu_present)}"
+ )
requests.get(request_message)
except Exception:
diff --git a/src/ydata_profiling/utils/logger.py b/src/ydata_profiling/utils/logger.py
index 95a28434a..dc70c3208 100644
--- a/src/ydata_profiling/utils/logger.py
+++ b/src/ydata_profiling/utils/logger.py
@@ -1,7 +1,6 @@
"""
Logger function for ydata-profiling reports
"""
-from __future__ import absolute_import, division, print_function
import logging
@@ -9,32 +8,35 @@
from ydata_profiling.utils.common import analytics_features
+
class ProfilingLogger(logging.Logger):
def __init__(self, name, level=logging.INFO):
super().__init__(name, level)
def info(
- self,
- msg: object,
- ) -> None:
- super().info(f'[PROFILING] - {msg}.')
+ self,
+ msg: object,
+ ) -> None:
+ super().info(f"[PROFILING] - {msg}.")
def info_def_report(self, dataframe, timeseries: bool):
if dataframe == pd.DataFrame:
- dataframe = 'pandas'
- report_type = 'regular'
+ dataframe = "pandas"
+ report_type = "regular"
elif dataframe == type(None):
- dataframe = 'pandas'
- report_type='compare'
+ dataframe = "pandas"
+ report_type = "compare"
else:
- dataframe = 'spark'
- report_type = 'regular'
+ dataframe = "spark"
+ report_type = "regular"
- datatype='timeseries' if timeseries else 'tabular'
+ datatype = "timeseries" if timeseries else "tabular"
- analytics_features(dataframe=dataframe,
- datatype=datatype,
- report_type=report_type)
+ analytics_features(
+ dataframe=dataframe, datatype=datatype, report_type=report_type
+ )
- super().info(f'[PROFILING] Calculating profile with the following characteristics '
- f'- {dataframe} | {datatype} | {report_type}.')
\ No newline at end of file
+ super().info(
+ f"[PROFILING] Calculating profile with the following characteristics "
+ f"- {dataframe} | {datatype} | {report_type}."
+ )