Skip to content

Commit

Permalink
linting / cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fdosani committed Apr 26, 2024
1 parent 9957e8b commit a4fa508
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
9 changes: 4 additions & 5 deletions datacompy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,6 @@ def df_to_str(pdf: pd.DataFrame) -> str:
)

# Column Matching
cnt_intersect = self.intersect_rows.shape[0]
report += render(
"column_comparison.txt",
len([col for col in self.column_stats if col["unequal_cnt"] > 0]),
Expand Down Expand Up @@ -804,7 +803,7 @@ def columns_equal(
compare = pd.Series(
(col_1 == col_2) | (col_1.isnull() & col_2.isnull())
)
except:
except Exception:
# Blanket exception should just return all False
compare = pd.Series(False, index=col_1.index)
compare.index = col_1.index
Expand Down Expand Up @@ -842,13 +841,13 @@ def compare_string_and_date_columns(
(pd.to_datetime(obj_column) == date_column)
| (obj_column.isnull() & date_column.isnull())
)
except:
except Exception:
try:
return pd.Series(
(pd.to_datetime(obj_column, format="mixed") == date_column)
| (obj_column.isnull() & date_column.isnull())
)
except:
except Exception:
return pd.Series(False, index=col_1.index)


Expand Down Expand Up @@ -920,7 +919,7 @@ def calculate_max_diff(col_1: "pd.Series[Any]", col_2: "pd.Series[Any]") -> floa
"""
try:
return cast(float, (col_1.astype(float) - col_2.astype(float)).abs().max())
except:
except Exception:
return 0.0


Expand Down
1 change: 0 additions & 1 deletion datacompy/fugue.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ def _any(col: str) -> int:
any_mismatch = len(match_sample) > 0

# Column Matching
cnt_intersect = shape0("intersect_rows_shape")
rpt += render(
"column_comparison.txt",
len([col for col in column_stats if col["unequal_cnt"] > 0]),
Expand Down
1 change: 0 additions & 1 deletion tests/test_fugue/test_fugue_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ def test_report_pandas(

def test_unique_columns_native(ref_df):
df1 = ref_df[0]
df1_copy = ref_df[1]
df2 = ref_df[2]
df3 = ref_df[3]

Expand Down

0 comments on commit a4fa508

Please sign in to comment.