From d36c1104478b3afb1fb9403d004c7eb9a3425ab6 Mon Sep 17 00:00:00 2001 From: Jaroslaw Grabowski Date: Thu, 22 Apr 2021 10:02:16 +0200 Subject: [PATCH] STAR-497 fix pycodestyle (#123) --- pylib/cqlshlib/geotypes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pylib/cqlshlib/geotypes.py b/pylib/cqlshlib/geotypes.py index 0ab2bb03483e..bad2f2b85b1b 100644 --- a/pylib/cqlshlib/geotypes.py +++ b/pylib/cqlshlib/geotypes.py @@ -84,6 +84,7 @@ def _patch_get_converters(klass): when using prepared statements to batch load """ original_method = klass._get_converter + def new_method(self, cql_type): if cql_type.typename == 'PointType': return _convert_point @@ -102,12 +103,13 @@ def _patch_init(klass): when making queries with string literal values """ original_method = klass.__init__ + def new_method(self, *args, **kwargs): original_method(self, *args, **kwargs) ptypes = zip(self.protectors, self.coltypes) - clean = lambda t: re.sub("[\W]", "", t.split('.')[-1]) # discard java package names and ' characters + clean = lambda t: re.sub("[\\W]", "", t.split('.')[-1]) # discard java package names and ' characters gtypes = {'PointType', 'LineStringType', 'PolygonType'} - self.protectors = [protect_value if clean(t) in gtypes else p for p,t in ptypes] + self.protectors = [protect_value if clean(t) in gtypes else p for p, t in ptypes] klass.__init__ = new_method