mito-ds / mito

The mitosheet package, trymito.io, and other public Mito code.
https://trymito.io
Other
2.25k stars 151 forks source link

Unable to filter on function columns when duplicating a sheet #182

Open plasmonresonator opened 2 years ago

plasmonresonator commented 2 years ago

Describe the bug When I create a formula column in a sheet and then duplicate that sheet, on the new sheet, I am not able to filter on that formula column.

To Reproduce import example data file attached and perform the following actions

from mitosheet import *; register_analysis('UUID-dd867de1-367b-4797-9425-54aee56e4f28')

  1. Imported deleteme.xlsx import pandas as pd sheet_df_dictonary = pd.read_excel('deleteme.xlsx', engine='openpyxl', sheet_name=['Sheet1', 'Sheet2'], skiprows=0) Sheet1 = sheet_df_dictonary['Sheet1'] Sheet2 = sheet_df_dictonary['Sheet2']

  2. Added column new-column-e7gz to Sheet1 Sheet1.insert(2, 'new-column-e7gz', 0)

  3. Renamed new-column-e7gz to iseven in Sheet1 Sheet1.rename(columns={'new-column-e7gz': 'iseven'}, inplace=True)

  4. Set new-column-e7gz in Sheet1 to =if(Value1%2==0,True,False) Sheet1['iseven'] = IF(Sheet1['Value1']%2==0,True,False)

  5. Duplicated Sheet1 to Sheet1_copy Sheet1_copy = Sheet1.copy(deep=True)

on the duplicated sheet, try to filter on the 'iseven' column

Expected behavior I should be able to filter (or view summary stats, etc.) for all columns.

Desktop (please complete the following information):

naterush commented 2 years ago

@plasmonresonator thanks for the bug report! We knew there was some wacky-ness with filtering and duplicating, but this is wackier than I expected.

Can you currently filter on the first sheet? Or is the filter broken on both of them? If it's not broken on the first, then this is def a new bug - and I'll hop on it ASAP!

plasmonresonator commented 2 years ago

No problem! It does work on the first sheet still, just not the duplicated sheet.