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

feat(db_api): make rowcount property NotImplemented #603

Merged
merged 3 commits into from Oct 14, 2021

Conversation

@IlyaFaer
Copy link
Member

@IlyaFaer IlyaFaer commented Sep 30, 2021

The original issue: googleapis/python-spanner-sqlalchemy#121
As we're not able to implement rowcount property according to the PEP-249, erasing its functionality (which is actual for only single one case - UPDATE query in autocommit mode).

@google-cla google-cla bot added the cla: yes label Sep 30, 2021
@IlyaFaer IlyaFaer marked this pull request as ready for review Sep 30, 2021
@IlyaFaer IlyaFaer requested a review from as a code owner Sep 30, 2021
@IlyaFaer IlyaFaer requested a review from larkee Sep 30, 2021
larkee
larkee approved these changes Oct 11, 2021
@gcf-merge-on-green
Copy link
Contributor

@gcf-merge-on-green gcf-merge-on-green bot commented Oct 14, 2021

Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, one of your required reviews was not approved, or there is a do not merge label. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot.

@larkee larkee merged commit b5a567f into googleapis:main Oct 14, 2021
13 checks passed
@IlyaFaer IlyaFaer deleted the rowcount_not_implemented branch Oct 15, 2021
asthamohta added a commit to asthamohta/python-spanner that referenced this issue Nov 11, 2021
Co-authored-by: larkee <31196561+larkee@users.noreply.github.com>
@vi3k6i5
Copy link
Contributor

@vi3k6i5 vi3k6i5 commented Jan 12, 2022

Updates with autocommit is default in Django, which breaks with these changes, can we undo these changes? @IlyaFaer

@IlyaFaer
Copy link
Member Author

@IlyaFaer IlyaFaer commented Jan 12, 2022

@vi3k6i5, these changes were changed not very long ago, here #628

@vi3k6i5
Copy link
Contributor

@vi3k6i5 vi3k6i5 commented Jan 13, 2022

@IlyaFaer : The fix in #628 is not working for Django. In Django model object update in auto-commit mode checks for success by getting the _row_count value which is now returning -1 and thus Django thinks that the update failed. Can you share what might break if we completely undo this PR ?

@IlyaFaer
Copy link
Member Author

@IlyaFaer IlyaFaer commented Jan 13, 2022

@vi3k6i5, I don't think it'll break anything, you know, more.

But, as I see it, if we'll start to really count rows, it'll be incorrect in many cases (most likely Django will still be failing), because results are streamed piece by piece. We're just not able to always know how many results we've got.

Plus to this, there will be an operative property rowcount, which users will try to rely on, and it'll bring confusion (like it was in the first version).

Could you show traceback of the failure or something? If it's only actual for tests, I guess we can just skip them (as we're not able to support rowcount, why should we test it). If it's real case... well, let's see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants