Skip to content

Commit a646ea1

Browse files
committed
added __all__ declarations
1 parent 1c9040d commit a646ea1

18 files changed

+21
-41
lines changed

.github/workflows/dev-cicd.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ jobs:
1515
- name: Check out repo
1616
uses: actions/checkout@v4
1717
- name: Set up Python
18-
uses: actions/setup-python@v4
18+
uses: actions/setup-python@v5
1919
with:
2020
python-version: "3.10"
21+
cache: "pip"
2122
- name: Install pre-commit
2223
run: pip install pre-commit
2324
- name: Run pre-commit
24-
run: pre-commit run --all-files
25+
run: pre-commit run --all-files --show-diff-on-failure
2526

2627
build:
2728
runs-on: ubuntu-latest
@@ -46,9 +47,10 @@ jobs:
4647
docker-images: true
4748
swap-storage: true
4849
- name: Set up Python
49-
uses: actions/setup-python@v4
50+
uses: actions/setup-python@v5
5051
with:
5152
python-version: ${{ matrix.python-version }}
53+
cache: "pip"
5254
- name: Install Tesseract OCR
5355
run: |
5456
sudo apt-get update

datafog/exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from typing import Optional
88

9+
910
class DataFogException(Exception):
1011
"""
1112
Base exception for DataFog SDK.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
from .spacy_pii_annotator import SpacyPIIAnnotator
2+
3+
__all__ = ["SpacyPIIAnnotator"]

datafog/processing/text_processing/spacy_pii_annotator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ def annotate(self, text: str) -> Dict[str, List[str]]:
6363
if len(text) > MAXIMAL_STRING_SIZE:
6464
text = text[:MAXIMAL_STRING_SIZE]
6565
doc = self.nlp(text)
66-
classified_entities: Dict[str, List[str]] = {label: [] for label in PII_ANNOTATION_LABELS}
66+
classified_entities: Dict[str, List[str]] = {
67+
label: [] for label in PII_ANNOTATION_LABELS
68+
}
6769
for ent in doc.ents:
6870
if ent.label_ in classified_entities:
6971
classified_entities[ent.label_].append(ent.text)

datafog/services/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
from .image_service import ImageService
22
from .spark_service import SparkService
33
from .text_service import TextService
4+
5+
__all__ = ["ImageService", "SparkService", "TextService"]

datafog/services/image_service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ def __init__(self, use_donut: bool = False, use_tesseract: bool = True):
9595
PytesseractProcessor() if self.use_tesseract else None
9696
)
9797

98-
async def download_images(self, urls: List[str]) -> List[Union[Image.Image, BaseException]]:
98+
async def download_images(
99+
self, urls: List[str]
100+
) -> List[Union[Image.Image, BaseException]]:
99101
tasks = [
100102
asyncio.create_task(self.downloader.download_image(url)) for url in urls
101103
]

notes/story-1.8-tkt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
– Delete committed artifacts, extend .gitignore.
22
– Add CI jobs for lint (ruff/flake8), mypy, tests, bench.
3-
– Pin exact versions in requirements*.txt; keep full dependency set.
4-
– Update docs / README badges.
3+
– Pin exact versions in requirements\*.txt; keep full dependency set.
4+
– Update docs / README badges.

run_tests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env python
22

3-
import os
43
import subprocess
54
import sys
65

scripts/compare_benchmarks.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python3
22

33
import json
4-
import os
54
import sys
65

76

scripts/fixed_text_service.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
"""
55

66
import asyncio
7-
from typing import Dict, List, Optional, Union
7+
from typing import Dict, List, Union
88

99
from datafog.processing.text_processing.regex_annotator.regex_annotator import (
10-
AnnotationResult,
1110
RegexAnnotator,
1211
Span,
1312
)

0 commit comments

Comments
 (0)