Skip to content

Conversation

coder-aditi
Copy link

Please answer these questions before submitting your pull requests. Thanks!

  1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-2043406: Type Annotations for snowflake.connector.connect #2270

  2. Fill out the following pre-review checklist:

    • [ ✅] I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am modifying authorization mechanisms
    • I am adding new credentials
    • I am modifying OCSP code
    • I am adding a new dependency
  3. Please describe how your code solves the related issue.

The "snowflake.connector.connect" function did not have type annotations, even though the "SnowflakeConnection" constructor it wraps does. This made it hard for tools like MyPy or Pyright to check arguments during development.

This PR uses ParamSpec and Unpack from the typing module to match the constructor's signature in the connect function. It now allows static type checking of arguments, giving developers immediate feedback if they use incorrect parameters.

A test was added to ensure that type checkers properly identify invalid types.

  1. (Optional) PR for stored-proc connector:

N/A

Copy link

github-actions bot commented Jun 20, 2025


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the CLA.
✅ (coder-aditi)[https://github.com/coder-aditi]
@CoderAAA
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@coder-aditi
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@coder-aditi
Copy link
Author

recheck

@sfc-gh-dszmolka sfc-gh-dszmolka requested review from sfc-gh-mkubik, sfc-gh-mmishchenko and a team and removed request for a team, sfc-gh-mkubik and sfc-gh-mmishchenko June 21, 2025 07:34
@sfc-gh-mmishchenko sfc-gh-mmishchenko force-pushed the feature/add-type-annotations-to-connect branch from c0e9521 to 0a6df41 Compare June 30, 2025 10:23
@coder-aditi
Copy link
Author

Hi @sfc-gh-mmishchenko , @sfc-gh-mkubik please let me know if any modifications required. Thank you.

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.

SNOW-2043406: Type Annotations for snowflake.connector.connect
2 participants