-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
fix: ensure column name in description is string #20340
fix: ensure column name in description is string #20340
Conversation
Codecov Report
@@ Coverage Diff @@
## master #20340 +/- ##
==========================================
- Coverage 66.64% 66.48% -0.17%
==========================================
Files 1738 1738
Lines 65056 65066 +10
Branches 6885 6885
==========================================
- Hits 43356 43257 -99
- Misses 19953 20062 +109
Partials 1747 1747
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
""" | ||
Used to ensure column names from the cursor description are strings. | ||
""" | ||
if isinstance(value, str): |
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.
Is this necessary? Isn’t the fallback suffice?
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.
Yeah, it's not needed, I just thought it was clearer this way.
result_set.to_pandas_df().to_markdown() | ||
== """ | ||
| | date | open | high | low | close | adj close | volume | | ||
|---:|:-----------|--------:|--------:|--------:|--------:|------------:|---------:| |
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 love it when the test is longer than the fix. :)
* fix: ensure column name in description is string * Add unit test (cherry picked from commit f3b289d)
* fix: ensure column name in description is string * Add unit test (cherry picked from commit f3b289d)
SUMMARY
The
redshift_connector
driver returns column names as bytes in the cursor description. I added some logic to handle them correctly.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
Added a test.
ADDITIONAL INFORMATION