Skip to content

Commit 1e2fa10

Browse files
PkchaPkcha
authored andcommitted
feat: initial release
1 parent 307cba9 commit 1e2fa10

4 files changed

Lines changed: 22 additions & 26 deletions

File tree

src/ydata_profiling/model/handler.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,22 @@ def handle(self, dtype: str, *args, **kwargs) -> dict:
6060
return summary
6161

6262

63+
def get_render_map() -> Dict[str, Callable]:
64+
import ydata_profiling.report.structure.variables as render_algorithms
6365

66+
render_map = {
67+
"Boolean": render_algorithms.render_boolean,
68+
"Numeric": render_algorithms.render_real,
69+
"Complex": render_algorithms.render_complex,
70+
"Text": render_algorithms.render_text,
71+
"DateTime": render_algorithms.render_date,
72+
"Categorical": render_algorithms.render_categorical,
73+
"URL": render_algorithms.render_url,
74+
"Path": render_algorithms.render_path,
75+
"File": render_algorithms.render_file,
76+
"Image": render_algorithms.render_image,
77+
"Unsupported": render_algorithms.render_generic,
78+
"TimeSeries": render_algorithms.render_timeseries,
79+
}
80+
81+
return render_map

src/ydata_profiling/model/summarizer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from ydata_profiling.model.pandas.describe_supported_pandas import (
2828
pandas_describe_supported,
2929
)
30-
from ydata_profiling.model.summary_algorithms import (
30+
from ydata_profiling.model.summary_algorithms import ( # Check what is this method used for
3131
describe_file_1d,
3232
describe_image_1d,
3333
describe_path_1d,
@@ -50,8 +50,9 @@ def summarize(
5050
return self.handle(str(dtype), config, series, {"type": str(dtype)})
5151

5252

53+
# Revisit this with the correct support for Spark as well.
5354
class ProfilingSummarizer(BaseSummarizer):
54-
"""A summarizer supporting both Pandas and Spark DataFrames."""
55+
"""A summarizer for Pandas DataFrames."""
5556

5657
def __init__(self, typeset: VisionsTypeset, use_spark: bool = False):
5758
self.use_spark = use_spark and is_pyspark_installed()

src/ydata_profiling/report/structure/report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from ydata_profiling.config import Settings
88
from ydata_profiling.model import BaseDescription
99
from ydata_profiling.model.alerts import AlertType
10-
from ydata_profiling.report.structure.variables import get_render_map
10+
from ydata_profiling.model.handler import get_render_map
1111
from ydata_profiling.report.presentation.core import (
1212
HTML,
1313
Collapse,
Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from typing import Callable, Dict
2-
31
from ydata_profiling.report.structure.variables.render_boolean import render_boolean
42
from ydata_profiling.report.structure.variables.render_categorical import (
53
render_categorical,
@@ -19,26 +17,6 @@
1917
)
2018
from ydata_profiling.report.structure.variables.render_url import render_url
2119

22-
23-
def get_render_map() -> Dict[str, Callable]:
24-
render_map = {
25-
"Boolean": render_boolean,
26-
"Numeric": render_real,
27-
"Complex": render_complex,
28-
"Text": render_text,
29-
"DateTime": render_date,
30-
"Categorical": render_categorical,
31-
"URL": render_url,
32-
"Path": render_path,
33-
"File": render_file,
34-
"Image": render_image,
35-
"Unsupported": render_generic,
36-
"TimeSeries": render_timeseries,
37-
}
38-
39-
return render_map
40-
41-
4220
__all__ = [
4321
"render_boolean",
4422
"render_categorical",
@@ -54,5 +32,4 @@ def get_render_map() -> Dict[str, Callable]:
5432
"render_text",
5533
"render_timeseries",
5634
"render_url",
57-
"get_render_map",
5835
]

0 commit comments

Comments
 (0)