Errata

Essential SQLAlchemy

Errata for Essential SQLAlchemy, Second Edition

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
Printed, PDF, ePub, Mobi, , Other Digital Version
Page Chapter 4
Last paragraph

Chapter 4 states that:

While this chapter used a simple example, we will dive further into testing in Chapter 14, which looks at Flask, Pyramid, and pytest.

I couldn't see where pytest was used in chapter 14?

Note from the Author or Editor:
You are correct, we should have removed the references to Pyramid and pytest from that section.

Anonymous  May 25, 2019 
Printed, PDF, ePub, Mobi, , Other Digital Version
Page 7
last code example

Extra closing parenthesis.

Note from the Author or Editor:
The final code sample on the page does have an extra right parenthesis, and should be as follows:

Index('ix_test', mytable.c.cookie_sku, mytable.c.cookie_name)

Anonymous  Jan 23, 2016 
Printed, PDF, ePub, Mobi,
Page 8
Example 1.3

orders = Table('orders',metadata,
Column('order_id',Integer(),primary_key = True),
Column('user_id',ForeignKey('users.user_id')),
Column('shipped',Boolean(),default = False)
)

I do not believe Boolean was imported on page 4 while it looks like you have to manually import each type of Generic type representations.

Note from the Author or Editor:
Example 1.3 line 1 should be:
from sqlalchemy import ForeignKey, Boolean

instead of:
from sqlalchemy import ForeignKey

Anonymous  Jan 16, 2017 
Printed, PDF, ePub, Mobi, , Other Digital Version
Page 10
End of Example 1-4

"connection = engine.connect() " is missing from the end of the code on page 10 or somewhere after.

On page 14, example 2-2 required the connection to be already created.

It IS in the chapter 2 code on github.

Note from the Author or Editor:
We need to update Example 2-2 on page 14 to be:

connection = engine.connect() <1>
result = connection.execute(ins) <2>

<1> Initializes a connection to the database
<2> Executes the ins query against the database connection.

Anonymous  Apr 04, 2016 
Printed, PDF, ePub, Mobi, , Other Digital Version
Page 11
1st paragraph

The last sentence in the paragraph says "Alembic provides a way for us to preform these types of changes by leveraging the power of SQLAlchemy."

I think preform should be perform?

Note from the Author or Editor:
The last sentence in the paragraph says "Alembic provides a way for us to preform these types of changes by leveraging the power of SQLAlchemy." should say "Alembic provides a way for us to perform these types of changes by leveraging the power of SQLAlchemy."

Gary Shymkiw  Jan 09, 2020 
Printed, PDF, ePub, Mobi,
Page 79
class LineItems

cookie = relationship("Cookie", uselist=False, order_by=id)
should be
cookie = relationship("Cookie", uselist=False)

* it is correct on github

Note from the Author or Editor:
As stated in the errata submission, on Pg 79
cookie = relationship("Cookie", uselist=False, order_by=id)
should be
cookie = relationship("Cookie", uselist=False)

Anonymous  Feb 02, 2016 
Printed, PDF, ePub, Mobi,
Page 87
Limiting, Example 7-9, (1)

"This runs the query and slices the returned list. This can be very ineffecient with a large result set."

1. inefficient spelled as ineffecient.
2. According to the SQLAlchemy ORM tutorial, LIMIT and OFFSET by slices are supported. It does not cause the database to return the entire list.

ref:

Tutorial for SQLAlchemy 0.7, this is the earliest version available from the official site.
http://docs.sqlalchemy.org/en/rel_0_7/orm/tutorial.html#querying

Note from the Author or Editor:
Page 87 Limiting, Example 7-9, (1) should read:
This applied a limit of 2 to the query. Unlike slicing on SQLAlchemy Core queries, which runs the query and slices the returned list, this works efficiently with
a large result set.

Anonymous  Feb 26, 2016 
Printed, PDF, ePub, Mobi,
Page 99
Example 7-28 results (top of page)

The returned key of "pieguy" should actually be named "pieperson"

Note from the Author or Editor:
On page 99, the text below:
---
Example 7-28 results in:
(u'cakeeater', 1)
(u'cookiemon', 1)
(u'pieguy', 0)
---

Should read as below:

---
Example 7-28 results in:
(u'cakeeater', 1)
(u'cookiemon', 1)
(u'pieperson', 0)
---

David S White  Dec 23, 2015 
Printed, PDF, ePub, Mobi,
Page 100
Example 7-30 (top of page)

The line "query = query. where(Order. shipped == shipped)" should actually be "query = query.filter(Order.shipped == shipped)".

Note from the Author or Editor:
On Page 100 in Example 7-30 the line:
---
query = query. where(Order. shipped == shipped)
---

Should actually be:
---
query = query.filter(Order.shipped == shipped)
---

David S White  Dec 23, 2015 
Printed, PDF, ePub, Mobi,
Page 121
3rd Paragraph

"These files can be found in the CH10/ folder of this book’s example code" should read "These files can be found in the CH09/ folder of this book’s example code" (I downloaded the latest example code on March the 13th, 2016). My example code does not include the files in CH10, but it does in CH09 as expected, since this is chapter 9.

Note from the Author or Editor:
Page 121, 3rd paragraph
These files can be found in the CH10/ folder of this book’s example code" should read "These files can be found in the CH09/ folder of this book’s example code

Nico  Mar 14, 2016