Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug logging to odo. #502

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion odo/core.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from __future__ import absolute_import, division, print_function

from collections import namedtuple
from collections import namedtuple, Iterator
from contextlib import contextmanager
import logging
from warnings import warn

from datashape import discover
Expand All @@ -12,6 +14,7 @@
from .compatibility import map
from .utils import expand_tuples, ignoring

log = logging.getLogger(__name__)

ooc_types = set() # Out-of-Core types

Expand Down Expand Up @@ -103,11 +106,16 @@ def _transform(graph, target, source, excluded_edges=None, ooc_types=ooc_types,
path_proxy = IterProxy(pth)
for convert_from, convert_to, f, cost in path_proxy:
try:
log.debug('Transforming %s -> %s', convert_from.__name__, convert_to.__name__,
extra={'kwargs': kwargs, 'f': f, 'excluded_edges': excluded_edges, 'cost': cost}
)
x = f(x, excluded_edges=excluded_edges, **kwargs)
except NotImplementedError as e:
if kwargs.get('raise_on_errors'):
raise
warn(FailedConversionWarning(convert_from, convert_to, e))
log.warning('Failed on %s -> %s. Working around\nError message:\n%s',
convert_from.__name__, convert_to.__name__, e
)

# exclude the broken edge
excluded_edges |= {(convert_from, convert_to)}
Expand Down