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

text_type is not defined in the documentation #391

Closed
TaurusOlson opened this issue Nov 6, 2015 · 1 comment
Closed

text_type is not defined in the documentation #391

TaurusOlson opened this issue Nov 6, 2015 · 1 comment

Comments

@TaurusOlson
Copy link
Contributor

Hi onyxfish,

I was following the tutorial of agate until I got a NameError because of the undefined variable text_type in the section Computing new columns with the line of code:

In [117]: full_names = exonerations.compute([
    ('full_name', agate.Formula(text_type, lambda row: '%(first_name)s %(last_name)s' % row))
])
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-117-0432888c1ca8> in <module>()
      1 full_names = exonerations.compute([
----> 2     ('full_name', agate.Formula(text_type, lambda row: '%(first_name)s %(last_name)s' % row))
      3 ])

NameError: name 'text_type' is not defined

I guess something like:

text_type = agate.text.Text()

is missing.

@onyxfish
Copy link
Collaborator

onyxfish commented Nov 6, 2015

Good catch! Yes, when I wrote the docs to use the type guesser I neglected to change this. The correct (simpler) line would be:

full_names = exonerations.compute([
    ('full_name', agate.Formula(agate.Text(), lambda row: '%(first_name)s %(last_name)s' % row))
])

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

No branches or pull requests

2 participants