Skip to content

Commit

Permalink
Adding example of callable warnings in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-bunn committed Nov 13, 2017
1 parent a500d7f commit 27fbe9d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/source/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,19 @@ This exported format can be used to bootstrap a new :class:`~sandpaper.sandpaper
.. important:: The json serialization does not store any information about callables.
A ``UserWarning`` is raised during serialization if a callable is found.

.. code-block:: python
def _filter_handler(record, column, **kwargs):
return record[column].lower().startswith('north')
paper = SandPaper().translate_text({
r'FL': 'Florida',
r'NC': 'North Carolina'
}, callable_filter=_filter_handler)
paper.__json__()
# raises: UserWarning because of _filter_handler
.. _getting_started-limitations:

Expand Down

0 comments on commit 27fbe9d

Please sign in to comment.