Skip to content

Conversation

@dfalbel
Copy link
Contributor

@dfalbel dfalbel commented Nov 18, 2025

Addresses #10432

Release Notes

New Features

Bug Fixes

  • N/A

QA Notes

Creating a Redshift connection require some configuration, and there are possibly multiple different ways to setup authentication dependning on how the Redshift cluster is set.

The way that worked for me is:

  1. Set up awscli, (we have some internal instructions ) then run:
aws sso login --profile <profile>

The profile must have access to the Redshift cluster that you plan to use.

  1. Setting up a Redshift cluster:

The easiest way to setup a Redshift Cluster is creating a Serverless Redshihft cluster.
Go to the AWS dashboard -> AWS Redshift -> Serverless Dashboard -> Create Workgroup

Follow the steps. Remember to use only public security groups if you want to be able to access it locally.

After creating the workgroup, you should be able to acess the query editor from the AWS console. Make sure you can make some queries from there.

You'll also be able to find the workgrourp endpoint in the workgroup dashboard. This is what is used for the connection string.

There may be easier or better ways for this, specially if setting CI jobs. See slack discussion.

  1. Connect from Python

A connection can be created by installing the redshift_connector:

pip install redshift_connector

The create a connection with:

conn: redshift_connector.Connection = redshift_connector.connect(
    iam=True,
    database='dev',
    host='<workgroup endpoint>',
    profile='<profile you setup in 1>'
 )

@:connections

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:connections

readme  valid tags

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds AWS Redshift support to the Connections Pane, allowing users to connect to and browse Redshift databases within Positron.

Key Changes:

  • Implemented RedshiftConnection class with support for listing databases, schemas, tables/views, and fields
  • Added comprehensive test coverage for Redshift connections following the established testing patterns
  • Added redshift_connector dependency to test requirements

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
extensions/positron-python/python_files/posit/positron/connections.py Adds RedshiftConnection class with methods for connection management, object listing, and data preview. Updates connection wrapping logic to recognize Redshift connections.
extensions/positron-python/python_files/posit/positron/tests/test_connections.py Adds TestRedshiftConnectionsService class with comprehensive tests for connection registration, data containment checks, icon retrieval, object listing, field listing, and preview functionality.
extensions/positron-python/python_files/posit/test-requirements.txt Adds redshift_connector as a test dependency.
extensions/positron-python/python_files/posit/pinned-test-requirements.txt Pins redshift_connector to version 2.1.10 for Python versions < 3.14.

@dfalbel dfalbel force-pushed the connections/redshift branch 3 times, most recently from 5bf25e3 to 6a68d42 Compare November 26, 2025 13:45
@dfalbel dfalbel marked this pull request as ready for review November 26, 2025 13:49
@dfalbel dfalbel requested a review from isabelizimm November 26, 2025 14:36
@dfalbel dfalbel force-pushed the connections/redshift branch 3 times, most recently from ff609c0 to 4bbca37 Compare November 27, 2025 19:26
try:
import redshift_connector

HAS_REDSHIFT = "REDSHIFT_HOST" in os.environ
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a plan to have these running in CI (maybe in the nightlies or weekly or something) at some point?

Copy link
Contributor Author

@dfalbel dfalbel Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully, yes! But it will require a good amount of work setting up ephemeral infrastructure.

@dfalbel dfalbel force-pushed the connections/redshift branch from 4bbca37 to c7a489b Compare December 12, 2025 20:05
@dfalbel dfalbel force-pushed the connections/redshift branch from c7a489b to 379cbf2 Compare December 15, 2025 14:47
@dfalbel dfalbel merged commit 5cd4306 into main Dec 15, 2025
31 checks passed
@dfalbel dfalbel deleted the connections/redshift branch December 15, 2025 15:49
@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants