Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions generated_for_index/baskets.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<table border="1" class="dataframe">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this file and products.html were added due to a git mishap maybe, could you remove this generated_for_index folder and its content? (note this is the added generated_for_index at the top of the directory; the existing doc/generated_for_index does not need to change

<thead>
<tr style="text-align: right;">
<th>basket_ID</th>
<th>fraud_flag</th>
</tr>
</thead>
<tbody>
<tr>
<td>85517</td>
<td>0</td>
</tr>
<tr>
<td>83008</td>
<td>0</td>
</tr>
<tr>
<td>...</td>
<td>...</td>
</tr>
<tr>
<td>97639</td>
<td>0</td>
</tr>
<tr>
<td>95939</td>
<td>0</td>
</tr>
</tbody>
</table>
36 changes: 36 additions & 0 deletions generated_for_index/products.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th>basket_ID</th>
<th>cash_price</th>
<th>Nbr_of_prod_purchas</th>
</tr>
</thead>
<tbody>
<tr>
<td>85517</td>
<td>889</td>
<td>1</td>
</tr>
<tr>
<td>83008</td>
<td>1399</td>
<td>1</td>
</tr>
<tr>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
<tr>
<td>95939</td>
<td>1149</td>
<td>1</td>
</tr>
<tr>
<td>95939</td>
<td>7</td>
<td>1</td>
</tr>
</tbody>
</table>
28 changes: 15 additions & 13 deletions skrub/_reporting/_patching.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,21 @@ def _patch(
stashed_name = _stashed_name(method_name)
if not hasattr(cls, stashed_name):
setattr(cls, stashed_name, original_method)
setattr(
cls,
method_name,
lambda df: getattr(
TableReport(
df,
verbose=verbose,
plot_distributions=plot_distributions,
compute_associations=compute_associations,
),
method_name,
)(),
)

def _patched(df, *args, **kwargs):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you add the *args and **kwargs here?

report = TableReport(
df,
verbose=verbose,
plot_distributions=plot_distributions,
compute_associations=compute_associations,
)

report._set_minimal_mode()

return getattr(report, method_name)(*args, **kwargs)

setattr(cls, method_name, _patched)



def _unpatch(cls, method_name):
Expand Down
Loading