Revision 319de05d5fbebbebb47532209490a2f8380f5343 authored by Valentin Lorentz on 10 August 2020, 19:33:00 UTC, committed by Valentin Lorentz on 10 August 2020, 19:48:37 UTC
Before this commit, python-cassandra used the default row factory,
which creates anonymous named tuple on each query, which makes it
impossible to type CqlRunner properly.

This commit replaces the row factory with dict_factory, which creates
only dicts, and converts them to well-defined dataclasses.
Additionally, this stop leaking python-cassandra internals to
cassandra.storage.

This also has some great side-effects:

* methods of CqlRunner are now consistent with each other (eg. _add_one
  methods used to be a mix of objects, dictionaries, and taking each value
  as argument)
* it will allow me to deduplicate more codes in further commits (I
  already deduplicated insertions methods to use self._add_one, as
  it was meant on the initial write of this class)
* CqlRunner no longer needs to define lists with column names, they are
  automatically detected from the dataclasses
1 parent 7d332f5
Raw File
Makefile.local
TEST_DIRS := ./swh/storage/tests
TESTFLAGS=--hypothesis-profile=fast
back to top