Skip to content

Commit 15b15b6

Browse files
committedJul 6, 2024·
Remove excess whitespace at end of reports.
gh-21
1 parent a929123 commit 15b15b6

6 files changed

+5
-9
lines changed
 

‎.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ repos:
3535
entry: pytest
3636
language: python
3737
types: [python]
38-
stages: [pre-commit, pre-push]
38+
stages: [pre-push]
3939
always_run: true

‎src/pandahelper/reports.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ def __repr__(self):
235235
list(self.null_stats.items()), headers=["Summary of Nulls Per Row", ""]
236236
)
237237
output = ["".join([x, "\n\n"]) for x in [df_table, dtype_table, null_table]]
238-
return "".join(output)
238+
output = "".join(output).strip()
239+
return output + "\n"
239240

240241
def save_report(self, path):
241242
"""Save profile to provided path.
@@ -311,7 +312,8 @@ def __repr__(self):
311312
stats = {k: str(v) for k, v in self.stats.items()}
312313
stats_table = tabulate(list(stats.items()), headers=["Statistic", "Value"])
313314
output = ["".join([x, "\n\n"]) for x in [series_table, freq_table, stats_table]]
314-
return "".join(output)
315+
output = "".join(output).strip()
316+
return output + "\n"
315317

316318
def save_report(self, path):
317319
"""Save profile to provided path.

‎tests/test_data/test_df_profile_name.txt

-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,3 @@ standard deviation 2.04863
5454
median 8
5555
median absolute deviation 1
5656
skew 0.36218
57-

‎tests/test_data/test_df_profile_no_name.txt

-1
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,3 @@ standard deviation 2.04863
5353
median 8
5454
median absolute deviation 1
5555
skew 0.36218
56-

‎tests/test_data/test_series_borough_profile.txt

-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,3 @@ QUEENS 35 27.56%
1212
BROOKLYN 30 23.62%
1313
BRONX 19 14.96%
1414
STATEN ISLAND 3 2.36%
15-
16-
17-

‎tests/test_data/test_series_injured_profile.txt

-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ standard deviation 0.808249
3030
median 0
3131
median absolute deviation 0
3232
skew 5.3412
33-

0 commit comments

Comments
 (0)
Please sign in to comment.