We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Support for Redshift SUPER column types would be useful. https://docs.aws.amazon.com/redshift/latest/dg/super-overview.html
SUPER
Currently we are using something like this (uses SUPER with redshift dialect, and text with other dialects)
import json import sqlalchemy as sa import sqlalchemy.ext.compiler from sqlalchemy import types class _JSONText(types.Text): def bind_expression(self, bindvalue): return sa.func.json_parse(bindvalue) class SUPER(types.TypeDecorator): impl = types.Text def load_dialect_impl(self, dialect): if dialect.name == "redshift": return _JSONText() return super().load_dialect_impl(dialect) def process_bind_param(self, value, dialect): if not isinstance(value, str): return json.dumps(value) # should make json.JSONEncoder class configurable here return value @sqlalchemy.ext.compiler.compiles(SUPER, "redshift") def compile_super_redshift(type_, compiler, **kw): return "SUPER" @sa.event.listens_for(sa.Table, "column_reflect") def setup_super_type(inspector, table, column_info): if isinstance(column_info["type"], types.NullType): column_info["type"] = SUPER()
The text was updated successfully, but these errors were encountered:
How to import the SUPER type such that i could pass it as an argument in the dtype field while using pandas.DataFrame.to_sql ?
dtype
pandas.DataFrame.to_sql
Sorry, something went wrong.
Addressed in #235
No branches or pull requests
Support for Redshift
SUPER
column types would be useful.https://docs.aws.amazon.com/redshift/latest/dg/super-overview.html
Currently we are using something like this (uses
SUPER
with redshift dialect, and text with other dialects)The text was updated successfully, but these errors were encountered: