Skip to content

Commit

Permalink
fix(pandas): force backend options registration on trace.enable() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
gerrymanoim authored and cpcloud committed Jul 6, 2022
1 parent 7b94a49 commit 8818fe6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ibis/backends/dask/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import traceback
from datetime import datetime

import ibis
from ibis.backends.pandas.dispatcher import TwoLevelDispatcher
from ibis.config import options
from ibis.expr import types as ir
Expand Down Expand Up @@ -69,6 +70,10 @@ def add_one(v):

def enable():
"""Enable tracing."""
if options.dask is None:
# dask options haven't been registered yet - force module __getattr__
ibis.dask

options.dask.enable_trace = True
logging.getLogger('ibis.dask.trace').setLevel(logging.DEBUG)

Expand Down
4 changes: 4 additions & 0 deletions ibis/backends/pandas/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import traceback
from datetime import datetime

import ibis
from ibis.backends.pandas.dispatcher import TwoLevelDispatcher
from ibis.config import options
from ibis.expr import types as ir
Expand Down Expand Up @@ -82,6 +83,9 @@ def add_one(v):

def enable():
"""Enable tracing."""
if options.pandas is None:
# pandas options haven't been registered yet - force module __getattr__
ibis.pandas
options.pandas.enable_trace = True
logging.getLogger('ibis.backends.pandas.trace').setLevel(logging.DEBUG)

Expand Down

0 comments on commit 8818fe6

Please sign in to comment.