Skip to content

Commit bc3f628

Browse files
browniebrokelnagel
authored andcommitted
Replace dict type hints by typing.Dict
1 parent d03f17c commit bc3f628

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

django_datadog_logger/formatters/datadog.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def get_wsgi_request_user(wsgi_request):
7171

7272

7373
class DataDogJSONFormatter(json_log_formatter.JSONFormatter):
74-
def json_record(self, message: str, extra: dict, record: LogRecord) -> dict:
74+
def json_record(self, message: str, extra: typing.Dict, record: LogRecord) -> typing.Dict:
7575
log_entry_dict = {
7676
"message": message,
7777
"logger.name": record.name,
@@ -173,18 +173,18 @@ def json_record(self, message: str, extra: dict, record: LogRecord) -> dict:
173173

174174
return log_entry_dict
175175

176-
def get_datadog_attributes(self, record: LogRecord) -> dict:
176+
def get_datadog_attributes(self, record: LogRecord) -> typing.Dict:
177177
"""Helper to extract dd.* attributes from the log record."""
178178
return {attr_name: record.__dict__[attr_name] for attr_name in record.__dict__ if attr_name.startswith("dd.")}
179179

180180
def get_wsgi_request(self) -> typing.Optional[HttpRequest]:
181181
return django_datadog_logger.wsgi.get_wsgi_request()
182182

183-
def to_json(self, record: dict) -> str:
183+
def to_json(self, record: typing.Dict) -> str:
184184
"""Converts record dict to a JSON string."""
185185
return self.json_lib.dumps(record, cls=SafeJsonEncoder)
186186

187-
def extra_from_record(self, record: LogRecord) -> dict:
187+
def extra_from_record(self, record: LogRecord) -> typing.Dict:
188188
"""Returns `extra` dict you passed to logger.
189189
190190
The `extra` keyword argument is used to populate the `__dict__` of

0 commit comments

Comments
 (0)