Skip to content

Commit 2b6f9c6

Browse files
Fix regex library warnings (#7576)
Signed-off-by: Emmanuel Ferdman <[email protected]>
1 parent 39b0c22 commit 2b6f9c6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/datasets/dataset_dict.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def cleanup_cache_files(self) -> dict[str, int]:
266266

267267
def __repr__(self):
268268
repr = "\n".join([f"{k}: {v}" for k, v in self.items()])
269-
repr = re.sub(r"^", " " * 4, repr, 0, re.M)
269+
repr = re.sub(r"^", " " * 4, repr, count=0, flags=re.M)
270270
return f"DatasetDict({{\n{repr}\n}})"
271271

272272
def cast(self, features: Features) -> "DatasetDict":
@@ -846,7 +846,7 @@ def map(
846846
Note that the last batch may have less than `n` examples.
847847
A batch is a dictionary, e.g. a batch of `n` examples is `{"text": ["Hello there !"] * n}`.
848848
849-
If the function is asynchronous, then `map` will run your function in parallel, with up to one thousand simulatenous calls.
849+
If the function is asynchronous, then `map` will run your function in parallel, with up to one thousand simultaneous calls.
850850
It is recommended to use a `asyncio.Semaphore` in your function if you want to set a maximum number of operations that can run at the same time.
851851
852852
Args:
@@ -1911,7 +1911,7 @@ def push_to_hub(
19111911
class IterableDatasetDict(dict):
19121912
def __repr__(self):
19131913
repr = "\n".join([f"{k}: {v}" for k, v in self.items()])
1914-
repr = re.sub(r"^", " " * 4, repr, 0, re.M)
1914+
repr = re.sub(r"^", " " * 4, repr, count=0, flags=re.M)
19151915
return f"IterableDatasetDict({{\n{repr}\n}})"
19161916

19171917
def with_format(
@@ -1988,7 +1988,7 @@ def map(
19881988
Note that the last batch may have less than `n` examples.
19891989
A batch is a dictionary, e.g. a batch of `n` examples is `{"text": ["Hello there !"] * n}`.
19901990
1991-
If the function is asynchronous, then `map` will run your function in parallel, with up to one thousand simulatenous calls.
1991+
If the function is asynchronous, then `map` will run your function in parallel, with up to one thousand simultaneous calls.
19921992
It is recommended to use a `asyncio.Semaphore` in your function if you want to set a maximum number of operations that can run at the same time.
19931993
19941994
Args:

tests/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def pytest_xdist_worker_id():
556556
if `-n 1` or `pytest-xdist` isn't being used.
557557
"""
558558
worker = os.environ.get("PYTEST_XDIST_WORKER", "gw0")
559-
worker = re.sub(r"^gw", "", worker, 0, re.M)
559+
worker = re.sub(r"^gw", "", worker, count=0, flags=re.M)
560560
return int(worker)
561561

562562

0 commit comments

Comments
 (0)