Skip to content

fix(ci): resolve YAML syntax error and benchmark test failure #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/beta-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ jobs:
BETA_VERSION="${BASE_VERSION}b1"
else
# If stable, bump minor and add beta (4.1.1 -> 4.2.0)
BASE_VERSION=$(python -c "import re; version = '$CURRENT_VERSION'; parts = version.split('.'); parts[1] = str(int(parts[1]) + 1); parts[2] = '0'; print('.'.join(parts))")
BASE_VERSION=$(python3 -c "
version = '$CURRENT_VERSION'
parts = version.split('.')
parts[1] = str(int(parts[1]) + 1)
parts[2] = '0'
print('.'.join(parts))
")
BETA_VERSION="${BASE_VERSION}b1"
fi

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,13 @@ jobs:
BASE_VERSION=$(echo $CURRENT_VERSION | cut -d'a' -f1)
else
# Bump minor version for alpha (4.1.1 -> 4.2.0)
BASE_VERSION=$(python -c "import re; version = '$CURRENT_VERSION'; parts = version.split('.'); parts[1] = str(int(parts[1]) + 1); parts[2] = '0'; print('.'.join(parts))")
BASE_VERSION=$(python3 -c "
version = '$CURRENT_VERSION'
parts = version.split('.')
parts[1] = str(int(parts[1]) + 1)
parts[2] = '0'
print('.'.join(parts))
")
fi

ALPHA_VERSION="${BASE_VERSION}a${DATE_STAMP}.${TIME_STAMP}.${COMMIT_SHORT}"
Expand Down
16 changes: 15 additions & 1 deletion datafog/services/text_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@

if TYPE_CHECKING:
from datafog.processing.text_processing.regex_annotator.regex_annotator import Span
else:
# Runtime import for Span when needed
Span = None


def _get_span_class():
"""Lazily import Span class when needed."""
global Span
if Span is None:
from datafog.processing.text_processing.regex_annotator.regex_annotator import (

Check warning on line 22 in datafog/services/text_service.py

View check run for this annotation

Codecov / codecov/patch

datafog/services/text_service.py#L21-L22

Added lines #L21 - L22 were not covered by tests
Span,
)
return Span

Check warning on line 25 in datafog/services/text_service.py

View check run for this annotation

Codecov / codecov/patch

datafog/services/text_service.py#L25

Added line #L25 was not covered by tests


class TextService:
Expand Down Expand Up @@ -172,7 +185,8 @@
chunk_spans = self.annotate_text_sync(chunk, structured=True)
# Adjust span positions to account for chunk offset
for span in chunk_spans:
adjusted_span = Span(
SpanClass = _get_span_class()
adjusted_span = SpanClass(

Check warning on line 189 in datafog/services/text_service.py

View check run for this annotation

Codecov / codecov/patch

datafog/services/text_service.py#L188-L189

Added lines #L188 - L189 were not covered by tests
start=span.start + current_offset,
end=span.end + current_offset,
text=span.text,
Expand Down