From 40107af22e91d110bc3f16d0dfa5a498521073a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Bult=C3=A9?= Date: Thu, 4 Oct 2018 21:52:27 +0200 Subject: [PATCH] Do not break if format is not in `FORMAT_MAP` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid errors on data such as: ``` { "name": "date_maj", "description": "Date de mise à jour des données", "examples": "2018/08/08, 2015/12/30", "required": true, "type": "date", "format": "%Y/%m/%d" } ``` --- table_schema_to_md.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/table_schema_to_md.py b/table_schema_to_md.py index 197d7f3..4744abc 100755 --- a/table_schema_to_md.py +++ b/table_schema_to_md.py @@ -90,7 +90,7 @@ def format_description(description): def format_format(format_val): """ Return markdown format information """ - return "- `{}` {}\n".format(format_val, FORMAT_MAP[format_val]) + return "- `{}` {}\n".format(format_val, FORMAT_MAP.get(format_val, '')) def format_type_specific_info(col_content): -- GitLab