mito-ds / mito

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

Dates in column headers errors #216

Open aarondr77 opened 2 years ago

aarondr77 commented 2 years ago

Describe the bug Mito does a bad job of handling dates in column headers.

To Reproduce Run this code in a Jupter notebook

import pandas as pd
import numpy as np
import mitosheet
zz = np.random.rand(10000,10000)

def create_header():
    names = []
    for i in range(10000):
        names.append(f'Path_{i}')

    return names

col_head = create_header()

infer_datetime_format=True
z = pd.date_range(start='18/12/1994', end='05/04/2022') 

df =pd.DataFrame(zz, columns = col_head)
df.insert(loc=0, column='Date', value = z)
df.set_index('Date', inplace= True)
df1 = df.T
df1.head(5)

mitosheet.sheet(df1, view_df=True)
Screen Shot 2022-04-05 at 10 29 43 AM
naterush commented 2 years ago

Ok, the update is I spent an hour on this and I was not able to create a statisfactory solution. The main issue is that the only two solution I can think of that seems straight forward seem to result in a performance impact that we don't want to go for.

If you want to see it, check out the branch date-header-fix. Check out the two different commits - they each try two solutions. Even on running the tests alone, they are noticeable (about 30%) slower. Maybe this was just a fluke, so try yourself.

Let me know thoughts - feel free to take a shot.