-
Notifications
You must be signed in to change notification settings - Fork 4
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 schema support for load_csv
#87
base: main
Are you sure you want to change the base?
Conversation
examples/load_csv.py
Outdated
@@ -57,6 +57,13 @@ def run(database: str, engine: str, fname: str, relation: str, | |||
help="relation name (default: file name)") | |||
p.add_argument("-p", "--profile", type=str, default="default", | |||
help="profile name") | |||
p.add_argument( |
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.
please format this like the surrounding code
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.
The sdk now uses flake8 for linting, so that formatting changed. I autoformatted using pep8 now.
railib/api.py
Outdated
inputs = {'data': data} | ||
command = _gen_syntax_config(syntax) | ||
command += "".join( |
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.
comprehension nested in a join behind a plusop is not ideal expression complexity.
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.
Oh how bad. Changed that!
Closes #25
I added support for specifying a schema dict when loading CSV. I adapted the existing integration test to include a schema definition.
I did not validate whether the passed schema dictionary is valid in the sense that it only specifies valid types, since I did not find a policy in the code how validations of input values are handled in general. We may create a follow-up issue on that so that the SDK yields meaningful errors on non-valid inputs.