Errata

Programming Google App Engine with Python

Errata for Programming Google App Engine with Python

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
ePub
example 2.5

when I run example 2.5 I get an error:
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1535, in __call__
rv = self.handle_exception(request, response, e)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1529, in __call__
rv = self.router.dispatch(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1102, in __call__
return handler.dispatch()
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 572, in dispatch
return self.handle_exception(e, self.app.debug)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 570, in dispatch
return method(*args, **kwargs)
File "C:\Users\Doug\development\newbookapp\newappbook\main.py", line 32, in get
userprefs = models.get_userprefs()
File "C:\Users\Doug\development\newbookapp\newappbook\models.py", line 18, in get_userprefs
userprefs = UserPrefs(key_name = user_id)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\ndb\model.py", line 2872, in __init__
self._set_attributes(kwds)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\ndb\model.py", line 2915, in _set_attributes
prop = getattr(cls, name) # Raises AttributeError for unknown properties.
AttributeError: type object 'UserPrefs' has no attribute 'key_name'

Note from the Author or Editor:
Already fixed in an upcoming draft.

Doug Patterson  Aug 19, 2014 
ePub
example 2.5

NDB supports id rather then key_name

I think you should change this to:
userprefs = UserPrefs(id = user_id)


works now that I made that change.

Note from the Author or Editor:
Already fixed in an upcoming draft (not yet on the website). Thanks!

Doug Patterson  Aug 19, 2014 
ePub
chapter 16, class UpgradeQuestEntitiesTaskHandler

# cursor is defined
(results, cursor, more) = query.fetch_page(TASK_SIZE)

if more:
job_id = self.request.get('job_id')
task_name = job_id + '_' + new_cursor <------- new_cursor is used
task_name = re.sub('[^a-zA-Z0-9_-]', '_', task_name)
taskqueue.add(
name=task_name,
url='/admin/jobs/upgradequests/task',
params={
'job_id': job_id,
'cursor': new_cursor }) <------- new_cursor is used

Note from the Author or Editor:
Fixed in draft.

robert rottermann  Mar 01, 2015 
PDF
Page 7
2nd to last paragraph

...Every query has a corresponding index maintained by the datastore. When the application performs a query, the datastore finds the index for that query, scans down to the first row that matches the query, then...
...In fact, the performance of an index-backed query is not affected by the number of entities in the datastore, only the size of the result set....
"scans down to the first row that matches" sounds like an o(n) algorithm which would be "affected by the number of entities in the datastore"
Perhaps could be clarified?

Note from the Author or Editor:
Minor wording change, fixed in draft.

G Lovelace  Feb 10, 2015 
PDF
Page 12
3rd paragraph

... generate a “discovery document” that are compatible with ...
"a ... document" is compatible ("is" vs "are")

Note from the Author or Editor:
Fixed in draft.

G Lovelace  Feb 10, 2015 
PDF
Page 32
United States

Replace "ge" with "get" in the following sentence: "Both easy_install and pip ge packages from the Python Package Index (PyPi) and install them in your Python installation’s site-packages collection."

Note from the Author or Editor:
Fixed in draft. Thanks!

David Radcliffe  Nov 30, 2014 
PDF
Page 59
last paragraph

Web Server Gateway Ingerface (vs. Interface)

Note from the Author or Editor:
Fixed in draft.

G Lovelace  Feb 10, 2015 
PDF
Page 93
United States

Inappropriate markup code in text: <ulink url="https://cloud.google.com/support/">paid support programs</ulink>. Also occurs on page 119.

Note from the Author or Editor:
Fixed in draft. Thanks!

David Radcliffe  Nov 30, 2014 
ePub
Page 108
5th para. (Starts with 'Another reason queries...)

The end of the paragraph "the speed of a query is not affected by the size of the data set" is ambiguous. Data set can sometimes refer to a result set (though it shouldn't). (eg: DataSet interface in Java). So this can be misinterpreted as the size of the result set does not affect the speed.

Note from the Author or Editor:
Good feedback, thank you! I'm revising this sentence to read, "In other words, the speed of a query is not affected by the size of the data being queried."

Kevin Hanna  Jul 14, 2014 
PDF
Page 108
2nd paragraph

Minor grammar: "analyze the logs of each version separate" ... should be separately.

Note from the Author or Editor:
Fixed in draft.

G Lovelace  Feb 13, 2015 
PDF
Page 126
United States

Last line of code runs off the page.

Note from the Author or Editor:
Wrapped the long "appcfg.py stop_module_version ..." command, using a line continuation character. (Fixed in draft.)

David Radcliffe  Nov 30, 2014 
PDF
Page 134
2nd to last paragraph of Caution-Note

"The datastore itself reserves all property names beginning and ending with two underscores (such as internal)."
Is "internal" is missing some underscores?

Note from the Author or Editor:
Markup error, fixed in draft.

G Lovelace  Feb 13, 2015 
PDF
Page 150
and following pages

"That is, filters have a logical-AND relationship with one another:" Easy to see that serial combinations of filters results in logical-AND. All you say about logical-OR is on page 153 "The WHERE clause ... does not support testing the logical-OR of two conditions." You mention negation of properties (in the context of obtaining descending sorts), so logical-OR should be obtainable by DeMorgan (though probably not efficiently). And a quick Google points to the existence of ndb.OR(), which appears to produce a union of two queries, which should be more efficient (interleaving two pre-sorted sets is o(n)). Why is this conspicuously absent from the book? Anything dire we should know?

Note from the Author or Editor:
Added a small section on ndb.OR().

G Lovelace  Feb 13, 2015 
PDF
Page 152
2nd to last paragraph

The underscore markup strikes again: "reserved name key like a property name. (That’s two underscores, the word “key,” and two underscores.)"

Note from the Author or Editor:
Markup error fixed in draft.

G Lovelace  Feb 15, 2015 
PDF
Page 154
United States

There are extra words in this phrase: "You get the Query object can be constructed in one of two ways, with equivalent results". I suggest deleting "You get".

Note from the Author or Editor:
Accepted, replaced "You get the +Query+ object can be" with "The +Query+ object can be" in Datastore Queries chapter. (Fixed in draft.)

David Radcliffe  Nov 30, 2014 
PDF
Page 157
Tip/Note

"You can cause this first call to happen in the background by calling the run() method before using the iterator it returns:"
The colon suggests that the following example should include a call to run() ...
but the code-snippet does not call run().

Note from the Author or Editor:
Changed run() to iter(). Fixed in draft.

G Lovelace  Feb 13, 2015 
PDF
Page 159
Figure 7-1

Wrong figure in 7-1. This is the same figure as Fig 8-2.

Note from the Author or Editor:
Fixed in draft. All Datastore Queries figures had the wrong chapter number in the filename. (Dunno how this happened.)

G Lovelace  Feb 13, 2015 
PDF
Page 168
Info/Note

Another minor markup glitch, for underscores:
"The kind names for these entities all begin with the characters _Stat (two underscores, Stat, and another underscore)."

Note from the Author or Editor:
Fixed all actual and potential markup errors involving "+_..._+" by switching to passthru DocBook syntax.

G Lovelace  Feb 15, 2015 
PDF
Page 226
first line

structured property based on the Notificai
tonPrefs class.
Notificaiton vs Notification

Note from the Author or Editor:
Fixed in draft.

G Lovelace  Feb 18, 2015 
PDF
Page 226
Section Header

Computed Proeprties vs Computed Properties

Note from the Author or Editor:
Fixed in draft.

G Lovelace  Feb 18, 2015 
PDF
Page 226
code snippet at bottom of page

@property decorator unexplained ... does not appear anywhere else in the book.
Perhaps that's okay, given this example is what *not* to do.

Note from the Author or Editor:
Acknowledged. This is a feature of Python, not specific to GAE. I agree that since it isn't a recommended practice, it doesn't need more emphasis.

G Lovelace  Feb 18, 2015 
PDF
Page 228
footnote

"ndb’s “structured properties” feature, discussed later."
Earlier, not later.

Note from the Author or Editor:
Fixed in draft.

G Lovelace  Feb 18, 2015 
PDF
Page 256
United States

This line of code appears in the middle of the page:
response = memcache.fetch('http://www.example.com/feed.xml')
Shouldn't it be urlfetch instead of memcache?

Note from the Author or Editor:
Replaced all instances of "memcache.fetch" with "urlfetch.fetch".

David Radcliffe  Nov 30, 2014