sanketsaurav / lore

Built-in function len used as condition PYL-C1802
Performance
Major
4 years ago5 years old
Do not use len(SEQUENCE) without comparison to determine if a sequence is empty
 42    def __setitem__(self, key, value):
 43        with timer('write %s' % key):
 44            if isinstance(value, pandas.core.frame.DataFrame):
 45                if len(value): 46                    for c in value.columns:
 47                        first = value[c].iloc[0]
 48                        if isinstance(first, datetime) and \