eyaltrabelsi / pandas-log

The goal of pandas-log is to provide feedback about basic pandas operations. It provides simple wrapper functions for the most common functions that add additional logs
MIT License
214 stars 12 forks source link

All logs should be suppressed after disable being called #11

Closed eyaltrabelsi closed 5 years ago

eyaltrabelsi commented 5 years ago

Brief Description

Currently, after disabling method some methods still reproduce logs altough they shouldn't, because the reference of the pandas method is diffrent from the instance method.

Minimally Reproducible Code

with enable():
    df = pd.read_csv("../examples/pokemon.csv")
    (
        df.query("legendary==0")
        .query("type_1=='fire' or type_2=='fire'")
    )
df.query("legendary==1")
eyaltrabelsi commented 5 years ago

Fixed on the instance level by making sure we are in relevant context (withing enable and disable)