22
33import pandas as pd
44
5+ from ydata_profiling .config import Settings
56from ydata_profiling .model .summarizer import PandasProfilingSummarizer , format_summary
67from ydata_profiling .model .typeset import ProfilingTypeSet
78
89base_path = os .path .abspath (os .path .dirname (__file__ ))
910
1011
11- def test_summarizer (config ):
12+ def test_summarizer_base_types (config : Settings ):
1213 pps = PandasProfilingSummarizer (typeset = ProfilingTypeSet (config ))
1314
1415 _ = format_summary (pps .summarize (config , pd .Series ([1 , 2 , 3 , 4 , 5 ]), "Unsupported" ))
@@ -23,9 +24,23 @@ def test_summarizer(config):
2324 _ = format_summary (
2425 pps .summarize (config , pd .Series (["abc" , "abc" , "abba" ]), "Categorical" )
2526 )
27+
28+ _ = format_summary (
29+ pps .summarize (config , pd .Series ([True , False , True , False , False ]), "Boolean" )
30+ )
31+
32+
33+ def test_summarizer_url (config : Settings ):
34+ config .vars .url .active = True
35+ pps = PandasProfilingSummarizer (typeset = ProfilingTypeSet (config ))
2636 _ = format_summary (
2737 pps .summarize (config , pd .Series (["https://www.example.com" ]), "URL" )
2838 )
39+
40+
41+ def test_summarizer_path (config : Settings ):
42+ config .vars .path .active = True
43+ pps = PandasProfilingSummarizer (typeset = ProfilingTypeSet (config ))
2944 _ = format_summary (
3045 pps .summarize (
3146 config ,
@@ -40,6 +55,12 @@ def test_summarizer(config):
4055 "Path" ,
4156 )
4257 )
58+
59+
60+ def test_summarizer_file (config : Settings ):
61+ config .vars .path .active = True
62+ config .vars .file .active = True
63+ pps = PandasProfilingSummarizer (typeset = ProfilingTypeSet (config ))
4364 _ = format_summary (
4465 pps .summarize (
4566 config ,
@@ -53,6 +74,13 @@ def test_summarizer(config):
5374 "File" ,
5475 )
5576 )
77+
78+
79+ def test_summarizer_image (config : Settings ):
80+ config .vars .path .active = True
81+ config .vars .file .active = True
82+ config .vars .image .active = True
83+ pps = PandasProfilingSummarizer (typeset = ProfilingTypeSet (config ))
5684 _ = format_summary (
5785 pps .summarize (
5886 config ,
@@ -62,6 +90,3 @@ def test_summarizer(config):
6290 "Image" ,
6391 )
6492 )
65- _ = format_summary (
66- pps .summarize (config , pd .Series ([True , False , True , False , False ]), "Boolean" )
67- )
0 commit comments