Skip to content

Conversation

@vdonato
Copy link
Collaborator

@vdonato vdonato commented Mar 28, 2023

Note: This PR is being merged into feature/st.experimental_connection.

📚 Context

This PR adds an implementation for one of our first party connection classes: the SQL connection.
The SQL connection is a simple wrapper around SQLAchemy that plays nicely with a developer's
secrets.toml file and the st.experimental_connection factory function.

There are a few notable things missing from the SQL connection class for now. Notably,

  • Retries for the read_sql method still need to be implemented.
  • We need to add some unit tests for the class itself. This will be done in a later PR.

@vdonato vdonato added the security-assessment-completed Security assessment has been completed for PR label Mar 28, 2023
@vdonato vdonato requested a review from lukasmasuch March 28, 2023 00:48
@vdonato vdonato force-pushed the vdonato/sql-connection branch 2 times, most recently from c872658 to 98976a0 Compare March 28, 2023 01:22
@vdonato vdonato force-pushed the feature/st.experimental_connection branch from ea0e408 to 33b300e Compare March 29, 2023 00:13
@vdonato vdonato force-pushed the vdonato/sql-connection branch from 98976a0 to 1cfede6 Compare March 29, 2023 00:13
Copy link
Contributor

Choose a reason for hiding this comment

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

I still believe we need some way for additional secrets to be added as arguments in this call.

A good concrete example is BigQuery. I'd like to be able to configure my credentials_info in secrets.toml or provide a credentials_path and have them passed to create_engine().

Cite: https://github.com/googleapis/python-bigquery-sqlalchemy#authentication

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ack -- I'll address this when circling back to merging config options / params from various places for both this connector and the Snowpark one

@vdonato vdonato force-pushed the feature/st.experimental_connection branch from 33b300e to 151e36d Compare March 29, 2023 21:42
@vdonato vdonato changed the base branch from feature/st.experimental_connection to develop March 29, 2023 21:56
@vdonato vdonato changed the base branch from develop to feature/st.experimental_connection March 29, 2023 21:56
@vdonato vdonato force-pushed the vdonato/sql-connection branch from 1cfede6 to 6245642 Compare March 29, 2023 21:58
Copy link
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@vdonato vdonato merged this pull request into feature/st.experimental_connection Mar 31, 2023
@vdonato vdonato deleted the vdonato/sql-connection branch March 31, 2023 00:16
vdonato added a commit that referenced this pull request Mar 31, 2023
* Add implementation of SQL connection

* Use sqlalchemy.text for 2.0 compatibility

* Add unit tests for SQL connection

* Add autocommit kwarg to connection_factory overload
vdonato added a commit that referenced this pull request Mar 31, 2023
* Add implementation of SQL connection

* Use sqlalchemy.text for 2.0 compatibility

* Add unit tests for SQL connection

* Add autocommit kwarg to connection_factory overload
vdonato added a commit that referenced this pull request Apr 4, 2023
* Add implementation of SQL connection

* Use sqlalchemy.text for 2.0 compatibility

* Add unit tests for SQL connection

* Add autocommit kwarg to connection_factory overload
vdonato added a commit that referenced this pull request Apr 6, 2023
* Add implementation of SQL connection

* Use sqlalchemy.text for 2.0 compatibility

* Add unit tests for SQL connection

* Add autocommit kwarg to connection_factory overload
vdonato added a commit that referenced this pull request Apr 6, 2023
* Add implementation of SQL connection

* Use sqlalchemy.text for 2.0 compatibility

* Add unit tests for SQL connection

* Add autocommit kwarg to connection_factory overload
vdonato added a commit that referenced this pull request Apr 10, 2023
* Add implementation of SQL connection

* Use sqlalchemy.text for 2.0 compatibility

* Add unit tests for SQL connection

* Add autocommit kwarg to connection_factory overload
vdonato added a commit that referenced this pull request Apr 11, 2023
* Add implementation of SQL connection

* Use sqlalchemy.text for 2.0 compatibility

* Add unit tests for SQL connection

* Add autocommit kwarg to connection_factory overload
vdonato added a commit that referenced this pull request Apr 15, 2023
* Add implementation of SQL connection

* Use sqlalchemy.text for 2.0 compatibility

* Add unit tests for SQL connection

* Add autocommit kwarg to connection_factory overload
vdonato added a commit that referenced this pull request Apr 17, 2023
* Add implementation of SQL connection

* Use sqlalchemy.text for 2.0 compatibility

* Add unit tests for SQL connection

* Add autocommit kwarg to connection_factory overload
vdonato added a commit that referenced this pull request Apr 19, 2023
* Add implementation of SQL connection

* Use sqlalchemy.text for 2.0 compatibility

* Add unit tests for SQL connection

* Add autocommit kwarg to connection_factory overload
vdonato added a commit that referenced this pull request Apr 20, 2023
* Add implementation of SQL connection

* Use sqlalchemy.text for 2.0 compatibility

* Add unit tests for SQL connection

* Add autocommit kwarg to connection_factory overload
vdonato added a commit that referenced this pull request Apr 21, 2023
* Add implementation of SQL connection

* Use sqlalchemy.text for 2.0 compatibility

* Add unit tests for SQL connection

* Add autocommit kwarg to connection_factory overload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants