File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 11# Change Log
22
3+ ## [ 0.1.4] - 2022-02-10
4+
5+ - [ #7 ] ( https://github.com/andyh1203/target-jsonl/pull/7 )
6+ Create output dir if it does not exist
7+
38## [ 0.1.3] - 2022-02-10
49
510- [ #3 ] ( https://github.com/andyh1203/target-jsonl/pull/3 )
611 Add custom name config for filename
7- - [ #4 ] ( https://github.com/andyh1203/target-jsonl/pull/4 )
12+ - [ #5 ] ( https://github.com/andyh1203/target-jsonl/pull/5 )
813 feat: add adjustment to decimal precision and update singer-python
Original file line number Diff line number Diff line change 66
77setup (
88 name = 'target-jsonl' ,
9- version = '0.1.3 ' ,
9+ version = '0.1.4 ' ,
1010 description = 'Singer.io target for writing JSON Line files' ,
1111 long_description = readme ,
1212 long_description_content_type = 'text/markdown' ,
Original file line number Diff line number Diff line change 66import os
77import sys
88from datetime import datetime
9+ from pathlib import Path
910
1011import singer
1112from jsonschema import Draft4Validator , FormatChecker
@@ -53,6 +54,8 @@ def persist_messages(
5354 validators [o ['stream' ]].validate ((o ['record' ]))
5455
5556 filename = (custom_name or o ['stream' ]) + timestamp_file_part + '.jsonl'
57+ if destination_path :
58+ Path (destination_path ).mkdir (parents = True , exist_ok = True )
5659 filename = os .path .expanduser (os .path .join (destination_path , filename ))
5760
5861 with open (filename , 'a' , encoding = 'utf-8' ) as json_file :
You can’t perform that action at this time.
0 commit comments