-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Fix read_sql empty result with chunksize bug GH34411 #34429
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
Fix read_sql empty result with chunksize bug GH34411 #34429
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm @jorisvandenbossche
@JohanKahrstrom looks like a merge conflict - can you fix that up? ping @jorisvandenbossche or @jreback for second review |
019e1a1
to
27bc425
Compare
Hello @JohanKahrstrom! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-01-14 17:55:48 UTC |
@WillAyd, @jorisvandenbossche, @jreback, Merge conflict has been resolved, and commit history squashed. |
27bc425
to
3090358
Compare
... and fixed black formatting. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Thanks Will, I was trying to figure out how to rerun the azure check... |
can u merge master and we will look again |
@JohanKahrstrom can you add a release note |
…d.DataFrame if chunksize is set and the resultset is empty Added release note
3090358
to
bda0257
Compare
@jreback @simonjayhawkins Added release note, merged with master. Unrelated checks are failing, not sure what to do about those... |
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. |
@JohanKahrstrom Can you merge master to fix conflicts? Looks like this might be close to ready? |
c21d71b
to
065a809
Compare
/azp run |
Commenter does not have sufficient privileges for PR 34429 in repo pandas-dev/pandas |
@JohanKahrstrom can you merge master once more? (There's a conflict in whatsnew) |
…y-result-with-chunksize-bug-34411
@arw2019 Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JohanKahrstrom can you merge master and move the whatsnew note. i think this was ok.
doc/source/whatsnew/v1.2.0.rst
Outdated
@@ -669,6 +669,7 @@ I/O | |||
- :func:`read_csv` was closing user-provided binary file handles when ``engine="c"`` and an ``encoding`` was requested (:issue:`36980`) | |||
- Bug in :meth:`DataFrame.to_hdf` was not dropping missing rows with ``dropna=True`` (:issue:`35719`) | |||
- Bug in :func:`read_html` was raising a ``TypeError`` when supplying a ``pathlib.Path`` argument to the ``io`` parameter (:issue:`37705`) | |||
- :meth:`read_sql` returned an empty generator if ``chunksize`` was no-zero and the query returned no results. Now returns a generator with a single empty dataframe (:issue:`34411`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to 1.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jreback Done, thanks.
…y-result-with-chunksize-bug-34411
thanks @JohanKahrstrom |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
pd.read_sql
was returning an empty generator when chunksize is set and the query returns zero results. Now it correctly returns a generator with a single empty DataFrame (:issue:34411
).