Skip to content
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

DB-23237 Superset: datatypes are not being converted properly #8

Merged
merged 3 commits into from
Jan 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions superset/db_engine_specs/ocient.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,12 @@ def fetch_data(cls, cursor, lim=None):

if columns_to_sanitize:
# At least 1 column has to be sanitized.
for row in rows:
for info in columns_to_sanitize:
# Modify the element in-place.
v = row[info.column_index]
row[info.column_index] = info.sanitize_func(v)

def do_nothing(x):
return x

sanitization_functions = [do_nothing for _ in range(len(rows[0]))]
alexclavel-ocient marked this conversation as resolved.
Show resolved Hide resolved
for info in columns_to_sanitize:
sanitization_functions[info.column_index] = info.sanitize_func

rows = [[sanitization_functions[i](row[i]) for i in range(len(row))] for row in rows]
alexclavel-ocient marked this conversation as resolved.
Show resolved Hide resolved
return rows