Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
format_pattern = (" " * padding).join(
[
("{:" + (">" if h[3] else "") + str(h[2]) + "}")
for h in headers_columns_unequal_valid
]
)
print(format_pattern.format(*[h[0] for h in headers_columns_unequal_valid]), file=myfile)
print(
format_pattern.format(*["-" * len(h[0]) for h in headers_columns_unequal_valid]),
file=myfile,
)
for column_name, column_values in sorted(
self.columns_match_dict.items(), key=lambda i: i[0]
):
num_matches = column_values[MatchType.MATCH.value]
num_known_diffs = (
None
if self._known_differences is None
else column_values[MatchType.KNOWN_DIFFERENCE.value]
)
num_mismatches = column_values[MatchType.MISMATCH.value]
compare_column = self._base_to_compare_name(column_name)
if num_mismatches or num_known_diffs or self.show_all_columns:
output_row = [
column_name,
compare_column,
base_types.get(column_name),
compare_types.get(column_name),
str(num_matches),
str(num_mismatches),