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

SQL improvements #28

Merged
merged 3 commits into from
Jul 8, 2017
Merged

SQL improvements #28

merged 3 commits into from
Jul 8, 2017

Conversation

dmalan
Copy link
Member

@dmalan dmalan commented Jul 8, 2017

In psycopg2 driver, numeric columns are returned as decimal.Decimal, which is more precise than float but inconsistent with SQLite and, thus, some students' code. This PR pre-casts (lossily) decimal.Decimals to floats.

E.g., execute("SELECT * FROM users") might otherwise return:

[{'id': 1, 'username': 'foo', 'hash': 'bar', 'cash': Decimal('123.45')}]

@dmalan dmalan requested a review from brianyu28 July 8, 2017 01:33
@dmalan dmalan added this to the 2.1.1 milestone Jul 8, 2017
@brianyu28
Copy link
Member

Looks good to me!

@dmalan dmalan merged commit e8d421d into develop Jul 8, 2017
@dmalan dmalan deleted the sql-improvements branch July 8, 2017 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants