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

Add schema support for load_csv #87

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

gbrgr
Copy link

@gbrgr gbrgr commented Jun 9, 2022

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.

@gbrgr gbrgr requested a review from bradlo June 9, 2022 08:55
@@ -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(
Copy link
Collaborator

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

Copy link
Author

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(
Copy link
Collaborator

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.

Copy link
Author

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!

@gbrgr gbrgr requested a review from bradlo October 11, 2022 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add schema support to api.load_csv
2 participants