-
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
Add support for postgres bytea type #6987
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6987 +/- ##
==========================================
- Coverage 64.38% 64.38% -0.01%
==========================================
Files 421 421
Lines 20574 20576 +2
Branches 2251 2251
==========================================
+ Hits 13247 13248 +1
- Misses 7194 7195 +1
Partials 133 133
Continue to review full report at Codecov.
|
@villebro: I tried to verify this PR fix, now both preview and sqllab run query throws the following exception 2019-03-16 14:25:34,661:ERROR:root:'utf-8' codec can't decode byte 0xac in position 0: invalid start byte |
Ok let's reopen #6981 and take another stab at this. Any additional info you can give (postgres version, create table script, sample data that throws the error etc) will help track down the problem. |
@villebro: Here is the test case to reproduce the issue create table if not exists test_bytea ( Please, unzip and load data using copy copy test_bytea from '/Users/muru/Downloads/bytea.dat' WITH (FORMAT Binary); Ping me if you need any other information. |
@mmuru I was unable to get preview working in preview mode without excplicit handling for memoryview, but making this work seems fairly straight forward. Would this be expected behaviour? |
@villebro: Yes that's correct. I think, instead of displaying content of the binary data we should simply say "binary data" or something similar text. In superset released version 0.28.1, preview mode shows "Unserializable [<class 'memoryview'>]" for bytea column without any error. The issue is the user should able to perform select * from table (table contains bytea column) especially if the table has lot of columns. |
Psycopg2 returns a
memoryview
object forbytea
type, which can be read by calling.tobytes()
. Fixes #6981Before:
After