Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions flow/record/adapter/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@


class DefaultMissing(dict):
"""A dictionary subclass that returns a formatted string for missing keys.

Example:
>>> d = DefaultMissing({"foo": "bar"})
>>> d['foo']
'bar'
>>> d['missing_key']
'{missing_key}'
"""

def __missing__(self, key: str) -> str:
return key.join("{}")

Expand Down
2 changes: 1 addition & 1 deletion tests/docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?= -jauto
SPHINXOPTS ?= -jauto -w $(BUILDDIR)/warnings.log --fail-on-warning
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = build
Expand Down
5 changes: 5 additions & 0 deletions tests/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@
autodoc_member_order = "groupwise"

autosectionlabel_prefix_document = True

suppress_warnings = [
# https://github.com/readthedocs/sphinx-autoapi/issues/285
"autoapi.python_import_resolution",
]
Loading