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

Fix `DataFuture.__repr__` for default instantiation #164

Closed
annawoodard opened this Issue Mar 26, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@annawoodard
Collaborator

annawoodard commented Mar 26, 2018

In [9]: from parsl import *

In [10]: dfk = DataFlowKernel(config=config)
In [11]: unsorted_file = File("globus://037f054a-15cf-11e8-b611-0ac6873fc732/unsorted.txt")
In [12]: unsorted_file.stage_in()
DEBUG:parsl.app.futures:Creating DataFuture with parent : None
DEBUG:parsl.app.futures:Filepath : /Users/awoodard/unsorted.txt
Out[12]: ---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
~/software/anaconda3/envs/parsl_py36/lib/python3.6/site-packages/IPython/core/formatters.py in __call__(self, obj)
    700                 type_pprinters=self.type_printers,
    701                 deferred_pprinters=self.deferred_printers)
--> 702             printer.pretty(obj)
    703             printer.flush()
    704             return stream.getvalue()

~/software/anaconda3/envs/parsl_py36/lib/python3.6/site-packages/IPython/lib/pretty.py in pretty(self, obj)
    393                             if callable(meth):
    394                                 return meth(obj, self, cycle)
--> 395             return _default_pprint(obj, self, cycle)
    396         finally:
    397             self.end_group()

~/software/anaconda3/envs/parsl_py36/lib/python3.6/site-packages/IPython/lib/pretty.py in _default_pprint(obj, p, cycle)
    508     if _safe_getattr(klass, '__repr__', None) is not object.__repr__:
    509         # A user-provided repr. Find newlines and replace them with p.break_()
--> 510         _repr_pprint(obj, p, cycle)
    511         return
    512     p.begin_group(1, '<')

~/software/anaconda3/envs/parsl_py36/lib/python3.6/site-packages/IPython/lib/pretty.py in _repr_pprint(obj, p, cycle)
    699     """A pprint that just redirects to the normal repr function."""
    700     # Find newlines and replace them with p.break_()
--> 701     output = repr(obj)
    702     for idx,output_line in enumerate(output.splitlines()):
    703         if idx:

~/ci/parsl/parsl/app/futures.py in __repr__(self)
    182     def __repr__(self):
    183
--> 184         parent = self.parent.parent
    185         if parent:
    186             with parent._condition:

AttributeError: 'Future' object has no attribute 'parent'
@yadudoc

This comment has been minimized.

Contributor

yadudoc commented Mar 26, 2018

@lukaszlacinski, When the DFK creates a DataFuture, the DataFutures's parent is an AppFuture, and it's parent is a Future that tracks the task sent to the executor. In this case, we are creating a DataFutures which does not have an AppFuture intermediary.

To fix this we just need to check if the parent is an AppFuture or Future and set parent appropriately.

@annawoodard annawoodard added the bug label Mar 26, 2018

@annawoodard annawoodard added this to the Parsl-0.5.0 milestone Mar 26, 2018

yadudoc added a commit that referenced this issue Mar 27, 2018

yadudoc added a commit that referenced this issue Mar 27, 2018

yadudoc added a commit that referenced this issue Mar 27, 2018

@yadudoc

This comment has been minimized.

Contributor

yadudoc commented Mar 30, 2018

Fixed, closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment