Skip to content

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
help="relation name (default: file name)")
p.add_argument("-p", "--profile", type=str, default="default",
help="profile name")
p.add_argument(
Copy link
Contributor

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
Contributor

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