Skip to content

Commit 54c5afc

Browse files
committed
Reviewer suggestions
1 parent 42b18bd commit 54c5afc

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## Unreleased
44

5-
* Fix for duplicate dotted keys ([#46])
5+
* Fixed an issue in `StructlogFormatter` caused by a conflict with `event`
6+
(used for the log `message`) and `event.dataset` (a field provided by the
7+
`elasticapm` integration) ([#46](https://github.com/elastic/ecs-logging-python/pull/46))
68

79
## 1.0.0 (2021-02-08)
810

ecs_logging/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def merge_dicts(from_, into):
114114
into.setdefault(key, {})
115115
if isinstance(value, dict) and isinstance(into[key], dict):
116116
merge_dicts(value, into[key])
117-
elif into[key]:
117+
elif into[key] != {}:
118118
raise TypeError(
119119
"Type mismatch at key `{}`: merging dicts would replace value `{}` with `{}`. This is likely due to "
120120
"dotted keys in the event dict being turned into nested dictionaries, causing a conflict.".format(

tests/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ def validator(data_json):
9292

9393
@pytest.fixture
9494
def apm():
95+
if sys.version_info < (3, 6):
96+
pytest.skip("elasticapm only supports python 3.6+")
9597
if sys.version_info[0] >= 3:
9698
record_factory = logging.getLogRecordFactory()
9799
apm = elasticapm.Client({"SERVICE_NAME": "apm-service", "DISABLE_SEND": True})

tests/test_apm.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@
2727
from .compat import StringIO
2828

2929

30-
# elasticapm only supports python 3.6+
31-
if sys.version_info < (3, 6):
32-
pytestmark = [pytest.mark.skip]
33-
34-
3530
def test_elasticapm_structlog_log_correlation_ecs_fields(spec_validator, apm):
3631
stream = StringIO()
3732
logger = structlog.PrintLogger(stream)

0 commit comments

Comments
 (0)