From 21f7dc5f24668cf972612d6aa67a0ba3b0ac6f39 Mon Sep 17 00:00:00 2001 From: Chris Lambacher Date: Mon, 6 Jul 2020 14:26:35 -0400 Subject: [PATCH] cleanup python 3.8 escape sequence warnings in regex --- salesforce_bulk/salesforce_bulk.py | 2 +- salesforce_bulk/tests/test_salesforce_bulk.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/salesforce_bulk/salesforce_bulk.py b/salesforce_bulk/salesforce_bulk.py index ef1c2c3..864a7e8 100644 --- a/salesforce_bulk/salesforce_bulk.py +++ b/salesforce_bulk/salesforce_bulk.py @@ -306,7 +306,7 @@ def create_abort_job_doc(self): def query(self, job_id, soql, contentType='CSV'): if job_id is None: job_id = self.create_job( - re.search(re.compile("from (\w+)", re.I), soql).group(1), + re.search(re.compile(r"from (\w+)", re.I), soql).group(1), "query", contentType=contentType) job_content_type = self.job_content_types[job_id] diff --git a/salesforce_bulk/tests/test_salesforce_bulk.py b/salesforce_bulk/tests/test_salesforce_bulk.py index dcfcc1e..49a3925 100644 --- a/salesforce_bulk/tests/test_salesforce_bulk.py +++ b/salesforce_bulk/tests/test_salesforce_bulk.py @@ -267,10 +267,10 @@ def test_query(self): job_id = bulk.create_query_job("Contact", contentType=self.contentType) self.jobs.append(job_id) - self.assertIsNotNone(re.match("\w+", job_id)) + self.assertIsNotNone(re.match(r"\w+", job_id)) batch_id = bulk.query(job_id, "Select Id,Name,Email from Contact Limit 1000") - self.assertIsNotNone(re.match("\w+", batch_id)) + self.assertIsNotNone(re.match(r"\w+", batch_id)) while not bulk.is_batch_done(batch_id): print("Job not done yet...") @@ -294,11 +294,11 @@ def test_query_pk_chunk(self): job_id = bulk.create_query_job("Contact", contentType=self.contentType, pk_chunking=True) self.jobs.append(job_id) - self.assertIsNotNone(re.match("\w+", job_id)) + self.assertIsNotNone(re.match(r"\w+", job_id)) query = "Select Id,Name,Email from Contact" batch_id = bulk.query(job_id, query) - self.assertIsNotNone(re.match("\w+", batch_id)) + self.assertIsNotNone(re.match(r"\w+", batch_id)) try: i = 0 @@ -349,7 +349,7 @@ def test_upload(self): job_id = bulk.create_insert_job("Contact", contentType=self.contentType) self.jobs.append(job_id) - self.assertIsNotNone(re.match("\w+", job_id)) + self.assertIsNotNone(re.match(r"\w+", job_id)) batch_ids = [] data = [ @@ -362,7 +362,7 @@ def test_upload(self): for i in range(2): content = self.generate_content(data) batch_id = bulk.post_batch(job_id, content) - self.assertIsNotNone(re.match("\w+", batch_id)) + self.assertIsNotNone(re.match(r"\w+", batch_id)) batch_ids.append(batch_id) bulk.close_job(job_id) @@ -388,7 +388,7 @@ def test_upload_with_mapping_file(self): job_id = bulk.create_insert_job("Contact", contentType=self.contentType) self.jobs.append(job_id) - self.assertIsNotNone(re.match("\w+", job_id)) + self.assertIsNotNone(re.match(r"\w+", job_id)) batch_ids = [] data = [ @@ -425,7 +425,7 @@ def test_upload_with_mapping_file(self): for i in range(2): content = self.generate_content(data) batch_id = bulk.post_batch(job_id, content) - self.assertIsNotNone(re.match("\w+", batch_id)) + self.assertIsNotNone(re.match(r"\w+", batch_id)) batch_ids.append(batch_id) bulk.close_job(job_id)