Skip to content

Conversation

@yyuuttaaoo
Copy link

@yyuuttaaoo yyuuttaaoo commented Dec 5, 2025

Change-Id: I73c387651d49aadf40fecd8a1971e6e3236f1241
Co-developed-by: Cursor [email protected]

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Change-Id: I73c387651d49aadf40fecd8a1971e6e3236f1241
Co-developed-by: Cursor <[email protected]>
Change-Id: Ic62aac75a4c2b208936fc39d65afc58b4b098ec9
Co-developed-by: Cursor <[email protected]>
Change-Id: I6faf10b234dfc7ea22bf3c15bfb308ffb37ad7c2
Co-developed-by: Cursor <[email protected]>
Change-Id: I9cd411b9d681b1b2fbaddfe17df1fc36df0c5c2c
Co-developed-by: Cursor <[email protected]>
Change-Id: I703dc2e51251cbb4273133b91ad8097ae5b6895c
Co-developed-by: Cursor <[email protected]>
Change-Id: I0d416d8396fb973e00d9f5d9a09eb39127b42158
Co-developed-by: Cursor <[email protected]>
Change-Id: I1b9f215831c67b8bd1ccb915b806a232b5e226b1
Co-developed-by: Cursor <[email protected]>
@ralf0131
Copy link
Collaborator

ralf0131 commented Dec 8, 2025

There is a type check failure to be fixed.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds Python 3.9 compatibility by importing from __future__ import annotations in files that use the modern union type syntax (X | Y). This is necessary because Python 3.9 does not natively support the X | Y syntax for type unions without this future import - it was only introduced natively in Python 3.10. The import enables deferred evaluation of annotations, allowing the use of the modern syntax while maintaining backward compatibility.

  • Adds from __future__ import annotations to 9 Python files across multiple instrumentation packages
  • Updates the CHANGELOG with the fix description
  • Ensures consistency in import placement (first import after copyright header, before other imports)

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scripts/generate_instrumentation_readme.py Adds future annotations import for Python 3.9 compatibility
instrumentation-loongsuite/loongsuite-instrumentation-mem0/tests/conftest.py Adds future annotations import for Python 3.9 compatibility
instrumentation-loongsuite/loongsuite-instrumentation-mem0/src/opentelemetry/instrumentation/mem0/config.py Adds future annotations import for Python 3.9 compatibility
instrumentation-loongsuite/loongsuite-instrumentation-mcp/tests/test_websocket.py Adds future annotations import for Python 3.9 compatibility
instrumentation-loongsuite/loongsuite-instrumentation-mcp/tests/mcp_server.py Adds future annotations import for Python 3.9 compatibility
instrumentation-loongsuite/loongsuite-instrumentation-langchain/tests/instrumentation/langchain/test_langchain_instrumentor.py Adds future annotations import for Python 3.9 compatibility
instrumentation-loongsuite/loongsuite-instrumentation-langchain/src/opentelemetry/instrumentation/langchain/internal/_utils.py Adds future annotations import for Python 3.9 compatibility
instrumentation-loongsuite/loongsuite-instrumentation-dify/src/opentelemetry/instrumentation/dify/capture_content.py Adds future annotations import for Python 3.9 compatibility
instrumentation-genai/opentelemetry-instrumentation-google-genai/src/opentelemetry/instrumentation/google_genai/generate_content.py Adds future annotations import for Python 3.9 compatibility
CHANGELOG-loongsuite.md Documents the Python 3.9 compatibility fix (contains typo in PR title)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


### Fixed

- Add `from __future__ import annotations` to fix Python 3.9 compatibility for union type syntax (`X | Y`)
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

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

Typo in PR title: "compatiblitiy" should be "compatibility"

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

@yyuuttaaoo yyuuttaaoo changed the title fix: annotation compatiblitiy with python 3.9 fix: annotation compatibility with python 3.9 Dec 8, 2025
@yyuuttaaoo
Copy link
Author

There is a type check failure to be fixed.

It was introduce by the previous commits and is a problem from upstream. We can ignore the issue in this PR.

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.

4 participants