-
Notifications
You must be signed in to change notification settings - Fork 153
SNOW-2912540: add IS_V5_DRIVER constant; use it for SecretDetector/TelemetryData/TelemetryClient/ReauthenticationRequest imports and pandas/pyarrow/numpy resolution #4313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sfc-gh-fpawlowski
wants to merge
13
commits into
SNOW-2912540-decouple-oob-telemetry
Choose a base branch
from
SNOW-2912540-secret-detector-import
base: SNOW-2912540-decouple-oob-telemetry
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
fbaec77
SNOW-2912540: add IS_V5_DRIVER constant for version-conditioned conne…
sfc-gh-fpawlowski 2ebb35d
SNOW-2912540: define MissingOptionalDependency/pandas/pyarrow locally…
sfc-gh-fpawlowski 9128d49
SNOW-2912540: use IS_V5_DRIVER for TelemetryData import path
sfc-gh-fpawlowski 7c5908b
SNOW-2912540: revert local MissingOptionalDependency/pandas/pyarrow r…
sfc-gh-fpawlowski e5d4788
SNOW-2912540: fix MissingPandas import to match UD PR #1151's now-cur…
sfc-gh-fpawlowski 564be06
SNOW-2912540: fix TelemetryData import to a real, verified location o…
sfc-gh-fpawlowski b079d85
SNOW-2912540: remove _pandas_importer(), source pandas/installed_pand…
sfc-gh-fpawlowski c7d4c60
SNOW-2912540: dedup mock/_options.py's numpy handling against _common…
sfc-gh-fpawlowski 90fd479
SNOW-2912540: fix black formatting after removing _pandas_importer()
sfc-gh-fpawlowski 8460b3b
SNOW-2912540: fix flake8 F401/E402 in utils.py's IS_V5_DRIVER import …
sfc-gh-fpawlowski 2befb01
SNOW-2912540: gate ReauthenticationRequest/TelemetryClient/TelemetryF…
sfc-gh-fpawlowski 205b00e
SNOW-2912540: fix 4 integ test files' unconditional connector.options…
sfc-gh-fpawlowski 6568b8e
SNOW-2912540: extract options-related imports to new _internal/option…
sfc-gh-fpawlowski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| #!/usr/bin/env python3 | ||
| # | ||
| # Copyright (c) 2012-2025 Snowflake Computing Inc. All rights reserved. | ||
| # | ||
|
|
||
| from snowflake.connector.version import VERSION as connector_version | ||
|
|
||
| IS_V5_DRIVER: bool = connector_version[0] >= 5 | ||
|
|
||
| if IS_V5_DRIVER: | ||
| from snowflake.connector._common.extras import pandas # noqa: F401 | ||
| from snowflake.connector._common.extras import ModuleLikeObject # noqa: F401 | ||
| from snowflake.connector._common.extras import installed_pandas # noqa: F401 | ||
| from snowflake.connector._common.extras import ( | ||
| MissingOptionalDependency, | ||
| pyarrow, | ||
| installed_pyarrow, | ||
| ) | ||
| else: | ||
| from snowflake.connector.options import pandas # noqa: F401 | ||
| from snowflake.connector.options import ModuleLikeObject # noqa: F401 | ||
| from snowflake.connector.options import installed_pandas # noqa: F401 | ||
| from snowflake.connector.options import ( | ||
| MissingOptionalDependency, | ||
| MissingPandas, | ||
| pyarrow, | ||
| ) | ||
|
|
||
| # connector.options (v4) never exported installed_pyarrow as its own name. | ||
| installed_pyarrow: bool = not isinstance(pyarrow, MissingOptionalDependency) | ||
|
|
||
|
|
||
| def _missing_pandas() -> MissingOptionalDependency: | ||
| # v4 has no __init__ override (no-arg-subclass only); v5 deleted | ||
| # MissingPandas in favor of the positional-arg form. | ||
| if IS_V5_DRIVER: | ||
| return MissingOptionalDependency("pandas") | ||
| return MissingPandas() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can IS_V5_DRIVER be import from options instead of redefined?