-
Notifications
You must be signed in to change notification settings - Fork 151
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 all options to UnloadFromSelect, with SQLi protection #27
Add all options to UnloadFromSelect, with SQLi protection #27
Conversation
return str(q.compile(dialect=RedshiftDialect(), | ||
compile_kwargs={'literal_binds': True})) | ||
|
||
return str(q.compile( |
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 updated this to match the same helper functions in test_unload_from_select
5d6e5c8
to
64f1fe4
Compare
^aws_access_key_id=[A-Z0-9]{20}; | ||
aws_secret_access_key=[A-Za-z0-9/+=]{40} | ||
(?:;token=[A-Za-z0-9/+=]+)?$ | ||
""", re.VERBOSE) |
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.
Constants should be named in all caps, and I'd prefer RE
or REGEX
to RX
unless this is conforming to a standard I'm not aware of (CREDS_RE
).
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.
Done
64f1fe4
to
2854c96
Compare
delimiter='DELIMITER AS :delimiter' if el.delimiter is not None else '', | ||
encrypted='ENCRYPTED' if el.encrypted else '', | ||
fixed_width=( | ||
'FIXEDWIDTH AS :fixed_width' if el.fixed_width is not None else '' |
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.
Why check None
specifically here rather than relying on the boolean interpretation of el.fixed_width
? Would we want to omit this clause in the case of an empty list?
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.
None
is the default? I think I want it to break accordingly if someone passes an empty list or False. I'm not tied to this.
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.
okay I'm updating fixed_width, note null and delimiter must be is not None or we can't support the empty string null or delimiter value
2854c96
to
3a684a3
Compare
This is looking much nicer for the refactor. I like this PR. |
4afa5ae
to
d6693a6
Compare
validate credentials before format Better exception text prevent an empty FIXEDWITH string as that's an error.
d6693a6
to
cdcd103
Compare
…lect-with-SQLi-protection Add all options to UnloadFromSelect, with SQLi protection
…ons-to-UnloadFromSelect-with-SQLi-protection Add all options to UnloadFromSelect, with SQLi protection
No description provided.