Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support creating empty files for streams with at least one SCHEMA message but no RECORD messages #119

Open
edgarrmondragon opened this issue Jul 3, 2024 · 0 comments

Comments

@edgarrmondragon
Copy link
Member

I don't think that's possible with the way target-csv currently works. The logic to write to the file, and more importantly here create if it doesn't exist, lives in the process_batch implementation:

write_csv(
output_file,
context["records"],
self.schema,
escapechar=self.config.get("escape_character"),
)

My guess is that it's never called for empty streams because the method is only called when a "batch" is full, but that never happens for the stream in question. One fix I can think of is to add an optional early file creation step controlled by a new setting (e.g create_files_for_empty_streams), maybe within the Sink class __init__ method.

https://meltano.slack.com/archives/C069CQNHDNF/p1718436121705219?thread_ts=1718426268.425619&cid=C069CQNHDNF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant