From bc7ec09f7bf6279ec1a15b3d6de5df9d00d86f81 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) (cherry picked from commit d36c1104478b3afb1fb9403d004c7eb9a3425ab6) (cherry picked from commit f1eb25c7214e2d4803041cf29c22fd3b0d2ad263) (cherry picked from commit cf205511d4722bea92fab7391dc6809e86565fae) (cherry picked from commit 813359d7e8696fef7a595c854892db10dad00dbf) --- 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