Skip to content

Commit f45f712

Browse files
committed
Profiler: add assertion for StringColumnProfile.__str__ result.
1 parent df37150 commit f45f712

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

tests/test_profiles.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,43 @@ def test_StringColumnProfile(self):
8181
self.assertIsInstance(column_profile, StringColumnProfile)
8282
self.assertEqual(column_profile.minLength, 3)
8383
self.assertEqual(column_profile.maxLength, 4)
84+
self.assertEqual(
85+
str(column_profile),
86+
(
87+
'StringProfiles for column: a: {\n'
88+
' "completeness": 1.0,\n'
89+
' "approximateNumDistinctValues": 3,\n'
90+
' "dataType": "String",\n'
91+
' "isDataTypeInferred": false,\n'
92+
' "typeCounts": {\n'
93+
' "Boolean": 0,\n'
94+
' "Fractional": 0,\n'
95+
' "Integral": 0,\n'
96+
' "Unknown": 0,\n'
97+
' "String": 3\n'
98+
' },\n'
99+
' "histogram": [\n'
100+
' [\n'
101+
' "bazz",\n'
102+
' 1,\n'
103+
' 0.3333333333333333\n'
104+
' ],\n'
105+
' [\n'
106+
' "foo",\n'
107+
' 1,\n'
108+
' 0.3333333333333333\n'
109+
' ],\n'
110+
' [\n'
111+
' "bar",\n'
112+
' 1,\n'
113+
' 0.3333333333333333\n'
114+
' ]\n'
115+
' ],\n'
116+
' "minLength": 3,\n'
117+
' "maxLength": 4\n'
118+
'}'
119+
)
120+
)
84121

85122
self.assertEqual(column_profile.completeness, 1.0)
86123
self.assertEqual(column_profile.approximateNumDistinctValues, 3)

0 commit comments

Comments
 (0)