Skip to content

Commit

Permalink
cleanup python 3.8 escape sequence warnings in regex
Browse files Browse the repository at this point in the history
  • Loading branch information
lambacck committed Jul 6, 2020
1 parent 34ff5f7 commit 21f7dc5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion salesforce_bulk/salesforce_bulk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
16 changes: 8 additions & 8 deletions salesforce_bulk/tests/test_salesforce_bulk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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...")
Expand All @@ -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
Expand Down Expand Up @@ -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 = [
Expand All @@ -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)
Expand All @@ -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 = [
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 21f7dc5

Please sign in to comment.