Skip to content

fix: pin ddtrace to <4.8.0 to avoid import errors#811

Merged
rithikanarayan merged 1 commit intomainfrom
brettlangdon/pin.ddtrace.version
May 1, 2026
Merged

fix: pin ddtrace to <4.8.0 to avoid import errors#811
rithikanarayan merged 1 commit intomainfrom
brettlangdon/pin.ddtrace.version

Conversation

@brettlangdon
Copy link
Copy Markdown
Member

@brettlangdon brettlangdon commented May 1, 2026

What does this PR do?

Pin ddtrace dependency to <4.8.0

Motivation

datadog-lambda-python was relying on an internal/private module from dd-trace-py which has changed in 4.8.0. We did not catch the incompatibility until after 4.8.0 has been released.

Example error:

ImportError while importing test module '/go/src/github.com/DataDog/datadog-lambda-python/tests/test_tracing.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
venv/lib/python3.11/site-packages/_pytest/python.py:507: in importtestmodule
    mod = import_path(
venv/lib/python3.11/site-packages/_pytest/pathlib.py:587: in import_path
    importlib.import_module(module_name)
/usr/local/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1204: in _gcd_import
    ???
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1147: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:690: in _load_unlocked
    ???
datadog_lambda/cold_start.py:130: in wrapped_method
    return original_exec_module(module)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
datadog_lambda/cold_start.py:130: in wrapped_method
    return original_exec_module(module)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
venv/lib/python3.11/site-packages/_pytest/assertion/rewrite.py:197: in exec_module
    exec(co, module.__dict__)
tests/test_tracing.py:15: in <module>
    from ddtrace._trace._span_pointer import _SpanPointer
E   ImportError: cannot import name '_SpanPointer' from 'ddtrace._trace._span_pointer' (/go/src/github.com/DataDog/datadog-lambda-python/venv/lib/python3.11/site-packages/ddtrace/_trace/_span_pointer.py)

Testing Guidelines

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

@brettlangdon brettlangdon requested review from a team as code owners May 1, 2026 13:45
@brettlangdon brettlangdon requested a review from jchrostek-dd May 1, 2026 13:45
@rithikanarayan rithikanarayan merged commit 89084d6 into main May 1, 2026
103 of 104 checks passed
@rithikanarayan rithikanarayan deleted the brettlangdon/pin.ddtrace.version branch May 1, 2026 13:55
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