fix(python): isolate datadog config defaults#4586
Conversation
Signed-off-by: Harish Chandra Thakur <hcthakur2004@email.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4586 +/- ##
=======================================
Coverage 73.87% 73.87%
=======================================
Files 21 21
Lines 2354 2354
=======================================
Hits 1739 1739
Misses 615 615 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@hcthakur2004 mind making this ready for review so we can merge it? |
Done, thanks! |
There was a problem hiding this comment.
Pull request overview
This PR fixes a Python client bug where DatadogConfig used shared mutable dictionary defaults (retry and async_transport_rules), causing mutations in one config instance to leak into others. It aligns DatadogConfig with safe per-instance default behavior and adds regression tests to prevent reintroduction.
Changes:
- Replaced mutable
attr.field(default=...)dict defaults inDatadogConfigwith per-instance factories. - Added regression tests ensuring
retryandasync_transport_rulesdefaults are not shared between instances.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| client/python/src/openlineage/client/transport/datadog.py | Introduces factory functions for retry and async_transport_rules to avoid shared mutable defaults across DatadogConfig instances. |
| client/python/tests/test_datadog.py | Adds regression tests verifying per-instance isolation for default retry config and async transport rules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Harish Chandra Thakur <hcthakur2004@email.com> Co-authored-by: Harish Chandra Thakur <hcthakur2004@email.com>
Summary
Issue
Fixes #4585
Tests
uv run pytest tests/test_datadog.pyuv run ruff check src/openlineage/client/transport/datadog.py tests/test_datadog.py