提交 474d9330 编写于 作者: D Doug Farrell

Fixed syntax error in example 1 main.py and the add_new_book problem in example 2

上级 1027e68a
......@@ -30,9 +30,10 @@ def get_books_by_publisher(data, ascending=True):
Returns:
The sorted data as a pandas series
"""
return data.groupby("publisher")
.size()
.sort_values(ascending=ascending)
return (data.groupby("publisher")
.size()
.sort_values(ascending=ascending)
)
def get_authors_by_publisher(data, ascending=True):
......
......@@ -94,9 +94,8 @@ def add_new_book(session, author_name, book_title, publisher_name):
)
# Does book, author and publisher already exist?
if book is not None and author is not None and publisher is not None:
raise ValueError(
"New item exists", author_name, book_title, publisher_name
)
return
# Create the book
book = Book(title=book_title)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册