Skip to content

Conversation

dfalbel
Copy link
Contributor

@dfalbel dfalbel commented Aug 28, 2025

Addresses #8580

TODO:

  • add tests
  • add code generation for re-connection
  • variables pane integration

Release Notes

New Features

Bug Fixes

  • N/A

QA Notes

Request a Snowflake Developer account with IT, then use:

con = snowflake.connector.connect(
    account='<our snowflake account w/ the snowflake.info part>',
    authenticator='externalbrowser',
    user='<your work mail>'
)

%connection_show con

@dfalbel dfalbel force-pushed the connections/snowflake branch from 8e24bb1 to 577cedc Compare September 5, 2025 19:05
@dfalbel dfalbel marked this pull request as ready for review September 5, 2025 20:13
@dfalbel dfalbel requested a review from isabelizimm September 5, 2025 20:14
isabelizimm
isabelizimm previously approved these changes Sep 8, 2025
Copy link
Contributor

@isabelizimm isabelizimm left a comment

Choose a reason for hiding this comment

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

a few questions about previewing data, but code looks good! FYI: I don't have any snowflake creds so didn't try anything out locally. lmk if you'd like me to test it and I can hunt some down!

query = f'SELECT * FROM "{database.name}"."{schema.name}"."{table.name}" LIMIT 1000;'
var_name = var_name or "conn"
preview = self.conn.cursor().execute(query).fetch_pandas_all()
sql = (
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for adding this in! 🙌


database, schema, table = path

# Use DuckDB's native pandas integration via .df() method
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be snowflake? or does this use the builtin duckdb?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops! I copied the duckdb implements as a template and forgot to remove

# Use DuckDB's native pandas integration via .df() method
query = f'SELECT * FROM "{database.name}"."{schema.name}"."{table.name}" LIMIT 1000;'
var_name = var_name or "conn"
preview = self.conn.cursor().execute(query).fetch_pandas_all()
Copy link
Contributor

Choose a reason for hiding this comment

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

and it doesn't look like pandas is a required dependency, should we try/except to make sure it is available?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if pandas is not installed, this will error with a reasonably error message surfaced to the user through a notification in Positron.

This is hopefully enough to get users to install pandas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants