Skip to content

Commit f142bcc

Browse files
committed
Minor corrections to format
1 parent 9b470ee commit f142bcc

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

hed/tools/analysis/tabular_summary.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def get_summary(self, as_json=False) -> Union[dict, str]:
111111
"Value columns": value_cols,
112112
"Skip columns": self.skip_cols,
113113
"Files": self.files,
114-
"Limit on categorical values": str(self.categorical_limit),
114+
"Categorical limit": str(self.categorical_limit),
115115
}
116116
if as_json:
117117
return json.dumps(summary, indent=4)
@@ -180,7 +180,7 @@ def _update_categorical(self, tab_name, values, cat_counts):
180180
Parameters:
181181
tab_name (str): Name of a key indicating a categorical column.
182182
values (dict): A dictionary whose keys are unique categorical values.
183-
cat_counts(list): A list with two elements: total count of values and number of entries.
183+
cat_counts (list): A list with two elements: total count of values and number of entries.
184184
185185
"""
186186
if tab_name not in self.categorical_info:
@@ -311,6 +311,7 @@ def extract_summary(summary_info) -> "TabularSummary":
311311
value_cols=summary_info.get("Value columns", {}).keys(),
312312
skip_cols=summary_info.get("Skip columns", []),
313313
name=summary_info.get("Name", ""),
314+
categorical_limit=summary_info.get("Categorical limit", None),
314315
)
315316
new_tab.value_info = summary_info.get("Value columns", {})
316317
new_tab.total_files = summary_info.get("Total files", 0)

tests/tools/analysis/test_tabular_summary.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,14 @@ def test_categorical_limit_in_summary(self):
291291
dict1.update(stern_df)
292292

293293
summary = dict1.get_summary(as_json=False)
294-
self.assertIn("Limit on categorical values", summary)
295-
self.assertEqual(summary["Limit on categorical values"], "10")
294+
self.assertIn("Categorical limit", summary)
295+
self.assertEqual(summary["Categorical limit"], "10")
296296

297297
# Test with None
298298
dict2 = TabularSummary()
299299
dict2.update(stern_df)
300300
summary2 = dict2.get_summary(as_json=False)
301-
self.assertEqual(summary2["Limit on categorical values"], "None")
301+
self.assertEqual(summary2["Categorical limit"], "None")
302302

303303
def test_categorical_limit_extract_summary(self):
304304
# Test that categorical_limit is preserved through extract_summary

0 commit comments

Comments
 (0)