Skip to content

Conversation

sfc-gh-pczajka
Copy link
Collaborator

@sfc-gh-pczajka sfc-gh-pczajka commented Sep 8, 2025

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-2107016

  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.

This PR introduces an option to install snowflake-connector-python without boto3 and botocore dependencies

SNOWFLAKE_NO_BOTO=1 pip install snowflake-connector-python

It includes as well:

  • pre-commit check to ensure that all boto imports are included in try..except block
  • github workflow ensuring that the default installation includes boto dependencies, but "slim" one does not.

@sfc-gh-pczajka sfc-gh-pczajka added the DO_NOT_PORT_CHANGES_TO_SP Add this label when changes in this PR do not need to be port to SP connector label Sep 8, 2025
@sfc-gh-pczajka sfc-gh-pczajka requested a review from a team as a code owner September 8, 2025 16:03
@sfc-gh-pczajka sfc-gh-pczajka marked this pull request as draft September 8, 2025 16:03
setup.py Outdated

# Check if slim is being requested via environment variable
# (This is the most reliable way to detect slim installation intent)
is_slim_install = os.environ.get("SNOWFLAKE_SLIM_INSTALL", "").lower() in (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Refactor

Suggested change
is_slim_install = os.environ.get("SNOWFLAKE_SLIM_INSTALL", "").lower() in (
is_slim_install = os.environ.get("SNOWFLAKE_NO_BOTO", "").lower() in (

@sfc-gh-pczajka sfc-gh-pczajka changed the title PoC: slim installation Add option to rxclude boto3 and botocore from dependencies Sep 10, 2025
@sfc-gh-pczajka sfc-gh-pczajka changed the title Add option to rxclude boto3 and botocore from dependencies Add option to exclude boto3 and botocore from dependencies Sep 10, 2025
@sfc-gh-pczajka sfc-gh-pczajka marked this pull request as ready for review September 10, 2025 14:32
deactivate
rm -rf test_default_env

- name: Test installation with SNOWFLAKE_NO_BOTO=1 (should exclude boto)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we make this more generally into a slim package, in case we need to include additional dependencies in the near future?

Example: we're discovering more gaps in our WIF client-side story on Azure because we're rolling our own client library rather than using Microsoft's MSAL libraries. It would be nice to have the option to bundle MSAL later.

Having a slim package would give flexibility to include such dependencies, rather than a "noboto" package which only seems to be related to AWS boto.

@@ -152,6 +158,12 @@ def create_aws_attestation(

If the application isn't running on AWS or no credentials were found, raises an error.
"""
if not BOTO_AVAILABLE:
raise MissingDependencyError(
msg="boto3 or botocore dependency is not installed. [boto] extension is required for the AWS provider.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest a more user-facing and actionable error message:

Suggested change
msg="boto3 or botocore dependency is not installed. [boto] extension is required for the AWS provider.",
msg="AWS Workload Identity Federation is not supported in the slim snowflake-python-connect build. Please update your pip dependencies to use the full connector package instead.",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DO_NOT_PORT_CHANGES_TO_SP Add this label when changes in this PR do not need to be port to SP connector
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants