Skip to content

Fix pyright errors from weave ≥0.52.27 interface changes#497

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/fix-pyright-lint-errors
Draft

Fix pyright errors from weave ≥0.52.27 interface changes#497
Copilot wants to merge 4 commits intomainfrom
copilot/fix-pyright-lint-errors

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

Weave renamed OtelExportReq/OtelExportResOTelExportReq/OTelExportRes in v0.52.27 and added new abstract methods to TraceServerInterface/ObjectInterface in v0.52.29, causing 10 pyright errors.

  • Type rename: Updated otel_export signature and body to use OTelExportReq/OTelExportRes
  • Backward compat: Added a TYPE_CHECKING guarded shim that aliases old names to new names at runtime for weave < 0.52.27, keeping weave>=0.52.22 unchanged in pyproject.toml
  • Missing abstract stubs: Added annotation_queue_delete, annotation_queue_update (raise NotImplementedError) and eval_results_query (returns empty results) to InMemoryWeaveTraceServer
Original prompt

This section details on the original issue you should resolve

<issue_title>pyright on lint next fails</issue_title>
<issue_description>```bash
Run uv run --locked --no-sync pyright -p pyrightconfig.json
/home/runner/work/agent-lightning/agent-lightning/agentlightning/instrumentation/weave.py
/home/runner/work/agent-lightning/agent-lightning/agentlightning/instrumentation/weave.py:306:9 - error: Return type is unknown (reportUnknownParameterType)
/home/runner/work/agent-lightning/agent-lightning/agentlightning/instrumentation/weave.py:306:27 - error: Type of parameter "req" is unknown (reportUnknownParameterType)
/home/runner/work/agent-lightning/agent-lightning/agentlightning/instrumentation/weave.py:306:32 - error: Type of "OtelExportReq" is unknown (reportUnknownMemberType)
/home/runner/work/agent-lightning/agent-lightning/agentlightning/instrumentation/weave.py:306:36 - error: "OtelExportReq" is not a known attribute of module "weave.trace_server.trace_server_interface" (reportAttributeAccessIssue)
/home/runner/work/agent-lightning/agent-lightning/agentlightning/instrumentation/weave.py:306:54 - error: Type of "OtelExportRes" is unknown (reportUnknownMemberType)
/home/runner/work/agent-lightning/agent-lightning/agentlightning/instrumentation/weave.py:306:58 - error: "OtelExportRes" is not a known attribute of module "weave.trace_server.trace_server_interface" (reportAttributeAccessIssue)
/home/runner/work/agent-lightning/agent-lightning/agentlightning/instrumentation/weave.py:307:16 - error: Type of "OtelExportRes" is unknown (reportUnknownMemberType)
/home/runner/work/agent-lightning/agent-lightning/agentlightning/instrumentation/weave.py:307:16 - error: Return type is unknown (reportUnknownVariableType)
/home/runner/work/agent-lightning/agent-lightning/agentlightning/instrumentation/weave.py:307:20 - error: "OtelExportRes" is not a known attribute of module "weave.trace_server.trace_server_interface" (reportAttributeAccessIssue)
/home/runner/work/agent-lightning/agent-lightning/agentlightning/tracer/weave.py
/home/runner/work/agent-lightning/agent-lightning/agentlightning/tracer/weave.py:244:24 - error: Cannot instantiate abstract class "WeaveTracerManagedTraceServer"
"ObjectInterface.eval_results_query" is not implemented
"TraceServerInterface.annotation_queue_delete" is not implemented
and 1 more... (reportAbstractUsage)
10 errors, 0 warnings, 0 informations


Run `uv upgrade` first to reproduce. I think some signatures have changed. When fixing, try not to break backward compat.</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 28, 2026 03:15
Co-authored-by: ultmaster <8463288+ultmaster@users.noreply.github.com>
…nd add missing abstract method stubs

Co-authored-by: ultmaster <8463288+ultmaster@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Pyright lint errors in weave.py Fix pyright errors from weave ≥0.52.27 interface changes Feb 28, 2026
pyproject.toml Outdated

weave = [
"weave>=0.52.22",
"weave>=0.52.29",
Copy link
Contributor

@ultmaster ultmaster Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot No need to bump weave required version. to test, you need to use uv lock --upgrade to test latest version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted the weave version bump in f487e48. pyproject.toml and uv.lock are now unchanged. Added a TYPE_CHECKING guard for backward compat with the OTelExportReq/OTelExportRes rename so the code works at runtime with weave>=0.52.22.

@ultmaster
Copy link
Contributor

@copilot No need to bump weave required version. to test, you need to use uv lock --upgrade to test latest version.

Co-authored-by: ultmaster <8463288+ultmaster@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 28, 2026

@copilot No need to bump weave required version. to test, you need to use uv lock --upgrade to test latest version.

Reverted the weave version bump in f487e48. pyproject.toml and uv.lock are now unchanged. Used a TYPE_CHECKING guard for the OTelExportReq/OTelExportRes rename so pyright sees the new names but runtime still works with old weave.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.wandb.ai
    • Triggering command: /home/REDACTED/work/agent-lightning/agent-lightning/.venv/bin/pytest pytest tests/tracer/test_weave.py -v -m weave (dns block)
  • o151352.ingest.us.sentry.io
    • Triggering command: /home/REDACTED/work/agent-lightning/agent-lightning/.venv/bin/pytest pytest tests/tracer/test_weave.py -v -m weave (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

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.

pyright on lint next fails

2 participants