Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

FIX: _Paginator NoneType checking #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eavorobiev
Copy link

aiocassandra throws TypeError without this (e.g. when I use prepared statement for update query or resultset is empty)

@codecov
Copy link

codecov bot commented Mar 2, 2018

Codecov Report

Merging #17 into master will decrease coverage by 3.77%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #17      +/-   ##
==========================================
- Coverage     100%   96.22%   -3.78%     
==========================================
  Files           1        1              
  Lines         106      106              
  Branches       14       14              
==========================================
- Hits          106      102       -4     
- Misses          0        3       +3     
- Partials        0        1       +1
Impacted Files Coverage Δ
aiocassandra.py 96.22% <100%> (-3.78%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 17c6be2...85d091d. Read the comment docs.

@hellysmile
Copy link
Member

Thanks for info, I see the issue, fix should be little bit different, like to move https://github.com/eavorobiev/aiocassandra/blob/85d091d553665e1e5b4a4ff6ca4e81ebc0397a64/aiocassandra.py#L52 to first line of def _handle_page(self, rows): and place there or rows is None...

Would You be interested to continue to fix it?

@hellysmile
Copy link
Member

hellysmile commented Mar 14, 2018

Hey @eavorobiev

I've tried to dig deeper into that issue, but seems working fine for me...

Can You add test case which raises TypeError?

Sorry for confusing with hints to fix, but seems, if it breaks

        if rows is None:
            self._loop.call_soon_threadsafe(self._finish_event.set)
            return

might be enough as first line of

def _handle_page(self, rows):

And one more question, why You use execute_futures for update statement? Maybe You can use just execute_future ?

@hellysmile
Copy link
Member

I've tried to reproduce it, and yes it can raise TypeError, but there is no need to use execute_futures for results which to not return anything

@hellysmile
Copy link
Member

Maybe we need to raise RuntimeError if execute_futures is used for queries which can not return results, not sure is it possible to check it before execution

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants