Skip to content

How to use redshift_connector from Glue? #43

@dburtsev

Description

@dburtsev

Driver version

redshift_connector-2.0.882-py3-none-any.whl

Redshift version

PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.27747

Client Operating System

Glue 1.0

Python version

Python3 Glue version 1.0

Problem description

  1. Expected behaviour:
    Connect to the database

  2. Actual behaviour:
    CalledProcessError: Command '['/usr/local/bin/python', '-m', 'pip', 'install', '--target=/glue/lib/installation', '/tmp/glue-python-libs-fj9rfah5/redshift_connector-2.0.882-py3-none-any.whl']' returned non-zero exit status 1.

  3. Any other details that can be helpful:
    The script is running on my PC but doesn't tun on Glue

Python Driver trace logs

Reproduction code

import redshift_connector

Connects to Redshift cluster using AWS credentials

conn = redshift_connector.connect(
host='xyz.redshift.amazonaws.com',
database='xyz',
user='xyz',
password='xyz',
port = 5439
)

cursor: redshift_connector.Cursor = conn.cursor()
cursor.execute("SELECT version()")
return_value = cursor.fetchone()[0]
print(return_value)
conn.close

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions