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

assert_one() failures are noisy and unfriendly #31

Open
StevenMaude opened this issue Mar 4, 2015 · 2 comments
Open

assert_one() failures are noisy and unfriendly #31

StevenMaude opened this issue Mar 4, 2015 · 2 comments

Comments

@StevenMaude
Copy link
Contributor

Traceback (most recent call last):
  File "/home/me/.virtualenvs/databaker/bin/bake", line 11, in <module>
    sys.exit(main())
  File "/home/me/.virtualenvs/databaker/local/lib/python2.7/site-packages/databaker/bake.py", line 328, in main
    per_file(fn, recipe)
  File "/home/me/.virtualenvs/databaker/local/lib/python2.7/site-packages/databaker/bake.py", line 272, in per_file
    obs = recipe.per_tab(tab)
  File "a02.py", line 7, in per_tab
    obs = tab.filter("All Persons").assert_one().shift(DOWN)
  File "/home/me/.virtualenvs/databaker/local/lib/python2.7/site-packages/xypath/xypath.py", line 425, in assert_one
    len(self.__store)
xypath.xypath.MultipleCellsAssertionError: assert_one() : 2 cells in bag, not 1
exit: 0.089s,  3.129s total

Perhaps it should show the full output if --debug is enabled and otherwise something more concise like so that the user can immediately see the problem:

2 cells in bag, not 1 found in:
  File "a02.py", line 7, in per_tab
obs = tab.filter("All Persons").assert_one().shift(DOWN)

@scraperdragon
Copy link
Contributor

👍

@scraperdragon
Copy link
Contributor

#32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants