-
Notifications
You must be signed in to change notification settings - Fork 17
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
add piping format from/to shell copy commands #64
Conversation
757cfb5
to
73a270f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would try to make this a bit cleaner: Given that you want to use Format
from this onwards and the old way should get deprecated, I would:
- Add a "NativeFormat" which takes no options
- Make all users error if format and any of the old ones are given
- If the old ones are given: create a corresponding Format (maybe using some helper in format.py)
- Handle the new Format way in the actual commandline generation
That way at some point, we can add a warn into the old way and at some point remove it completely...
@jankatins You are right about what you write. But this might lead into breaking changes. I was quite cautious with the changes I did to not make any breaking change. That resulted (unfortunately) into ugly code. e.g. # ...
elif isinstance(pipe_format, CsvFormat):
csv_format = True
if delimiter_char is None:
# ... The purpose of this was to make it work that when someone uses the old and new logic combined. For example: someone upgrades their mara_db package and uses the copy command and patches manually the There are already so many I would like to do these changes mentioned above, but a) maybe in the next major release where we officially discontinue or drop the old parameters / or b) we implement unit tests for each database engines - especially for the Another option would be to put this change from the start into a newer major version which is incompatible with older versions of mara-pipelines. This is something I tried to avoid. |
From my point of view, this looks like a lot of complexity you are introducing for an edge case I would say should be taken care by a changelog entry: "If you do this ..., you have to change it to ...". Which points to a major release, as it is a breaking change. I know that we used a custom athena integration: create min cli command which spits out data to stdout, create a new mara DB class, create and register the copy commands for this class, done... These will break, because of the additional |
hmm... yea, you're right. I will redesign this implementation ... |
@jankatins I redesigned the solution now. Please reivew. |
* comma deimiliter * no header * no footer as it is defined by default in RFC-4180 quote_char is by default None
@jankatins You wrote:
Why not creating a PR which adds Athena support for the mara_db package? Then we can make sure that the code works even with the upcoming breaking change. Or is there something private in it you don’t wanna share? |
See #56