News for hackers. Stuff that matters.
Re:Django 2.2 by michelpp on Monday April 01, 2019 @02:00PM (#19546161)
pandas.read_sql('select first_name, last_name, email from users', conn)

this approach avoids the full data copy calling '.all()' materializes.

Re:Django 2.2 by fredley on Monday April 01, 2019 @02:16PM (#19546351)
.all() doesn't actually do anything, and could be omitted. The beauty of this setup is if you need to rewrite the implementation of .to_dataframe() to optimize it, you can (e.g. to remove the .values() you're worries about and use your above code)