Skip to content

Commit

Permalink
fix: minor tweaks (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgpayne authored Jan 16, 2023
1 parent c0a0b0a commit 98261d0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions target_singer_jsonl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ def urljoin(*args):
return reduce(join_slash, args) if args else ""


def emit_state(state):
if state is not None:
line = json.dumps(state)
logger.debug(f"Emitting state {line}")
sys.stdout.write(f"{line}\n")
sys.stdout.flush()


def get_file_path(stream, destination, config):
filename = f"{stream}/{stream}-{file_timestamp}.singer.gz"
if destination == "local":
Expand Down Expand Up @@ -103,6 +95,14 @@ def write_lines(config, stream, lines):
)


def emit_state(state):
if state is not None:
line = json.dumps(state)
logger.debug(f"Emitting state {line}")
sys.stdout.write(f"{line}\n")
sys.stdout.flush()


def persist_lines(config, lines):
state = None
schemas = {}
Expand Down Expand Up @@ -196,7 +196,7 @@ def persist_lines(config, lines):
raise Exception(f"Unknown message type {t} in message {message}")

for stream, messages in stream_lines.items():
if len[messages] > 1: # don't write SCHEMA without any RECORDs
if len(messages) > 1: # don't write SCHEMA without any RECORDs
write_lines(config, stream, messages)

return state
Expand Down

0 comments on commit 98261d0

Please sign in to comment.