Closed madopal closed 2 years ago
Sorry, I'm a bit confused. You want to remove semi-colons because it will throw the error or you want to remove the semi-colon because it will further suppress the error?
So, it seems like the benefit of looking up the header can be done regardless of whether or not the query is terminated by a semicolon, no? If so, then we need to either 1) strip the semicolon when we get it and try to get the header or 2) document that if any SQL query is semicolon terminated, it will silently fail & skip the optimization. I had assumed the former, as if it fails it's no worse than how it is now, but if we have a reason for not gaining the benefit of the header when the query is semicolon-terminated, then it should at least be mentioned in the higher level call, right?
ok, I get what you are saying. I have no opinion since i'm not familiar with this code. @mheilman do you have any thoughts?
The _get_headers
code should just be removed. It was added at a time when SQL Scripts did not support doing a parallel unload if headers were requested. At that time, rather than fixing it on the API side, it was easier to add this code on the client side. The API side has since been addressed making the _get_headers
code redundant. The bug this PR addresses has already been addressed in the API side code.
I'm happy to provide context to things in the Python API client like this, but we do need to expand the bus factor and get other people involved in CR.
Happy to just close this if that's the solution @jkulzick, unless you'd rather I modify it to remove _get_headers?
Happy to just close this if that's the solution @jkulzick, unless you'd rather I modify it to remove _get_headers?
@madopal yeah, we should modify this to remove _get_headers
@skomanduri Tagging you for review here, as we'd need someone with knowledge of the Platform code. In particular, is Kulzick's comment still accurate at this point given the current state of Platform? Thank you.
@jacksonlee-civis Yep, the comment is still accurate! This logic has been moved into Platform so it can be removed from the client.
This PR removes the helper function
_get_headers
used bycivis.io.read_civis_sql
.Originally, @madopal discovered a bug in this helper function. John Kulzick then commented that this helper function should in fact be removed based on the current state of the internal Civis Platform code.
For reference, the following is @madopal 's original PR description: