Skip to content

fix(service): restore services package imports - #834

Draft
LucStr wants to merge 2 commits into
mainfrom
fix(service)/restore-services-package-imports
Draft

fix(service): restore services package imports#834
LucStr wants to merge 2 commits into
mainfrom
fix(service)/restore-services-package-imports

Conversation

@LucStr

@LucStr LucStr commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

What

src/rapidata/service/services/__init__.py still imported pipeline_service and workflow_service, which were deleted in #830 (refactor!: remove order flow and pipeline/workflow APIs from the SDK). It also never listed payment_service / translation_service, which do exist and are used.

Why this breaks every API call, not just pipelines

openapi_service.py reaches each backend service through a lazy
from rapidata.service.services.<name>_service import .... That import runs the package
__init__ first, so one dead name there takes down every service accessor:

>>> import rapidata.service.services.order_service
ModuleNotFoundError: No module named 'rapidata.service.services.pipeline_service'

Reproduced on main and against the published 3.21.0 wheel.

Found in production traces — rapidata-testing E2E on 3.21.0:

ValidationSetManager.create_classification_set
  → openapi_service.py:178 validation
  → services/__init__.py:8
ModuleNotFoundError: No module named 'rapidata.service.services.pipeline_service'

Changes

  1. Drop the two dead imports/exports.
  2. Add the two service modules that exist but were omitted (PaymentService, TranslationService).
  3. tests/service/test_services_package.py — asserts every __all__ name resolves and every *_service.py on disk is exported, so the next removal that forgets __init__ fails CI instead of shipping.

Verified the guard catches the regression: reverting __init__.py turns the new test into a collection error.

Test

uv run pytest tests/service -q      # 13 passed
uv run pytest tests -q              # 151 passed, 4 failed

The 4 failures are in tests/rapidata_client/audience/ and reproduce unchanged on main — unrelated to this PR.

Why CI didn't catch it

Two independent gaps, both closed here:

  1. pyright never looked at it. pyrightconfig.json included only src/rapidata/rapidata_client, and the workflow pinned working-directory to the same path — so src/rapidata/service/ was never type-checked. Widening the config to include it reports the bug directly:

    src/rapidata/service/services/__init__.py:8:6 - error: Import "rapidata.service.services.pipeline_service" could not be resolved (reportMissingImports)
    src/rapidata/service/services/__init__.py:12:6 - error: Import "rapidata.service.services.workflow_service" could not be resolved (reportMissingImports)
    

    src/rapidata/service/ is already clean under pyright, so this adds a guard without adding noise: uv run pyright → 0 errors.

  2. There is no pytest workflow. .github/workflows/ runs pyright, docs and release only, so the new test in this PR will not gate a future PR until a test job exists. I left that out deliberately — pytest tests is currently red on main (4 pre-existing failures in tests/rapidata_client/audience/), so adding the job belongs in a PR that also fixes or quarantines those. Worth doing next.

🔗 Session: https://poseidon.rapidata.internal/chat/node-18f661b70117

RapidPoseidon and others added 2 commits August 23, 2026 04:10
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: luca@rapidata.ai <25279790+LucStr@users.noreply.github.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: luca@rapidata.ai <25279790+LucStr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants