snowflake-connector-python 3.12.1__tar.gz → 3.12.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/DESCRIPTION.md +10 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/PKG-INFO +11 -1
- snowflake_connector_python-3.12.3/src/snowflake/connector/_utils.py +56 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/auth/_auth.py +16 -2
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/azure_storage_client.py +17 -1
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/bind_upload_agent.py +19 -6
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/connection.py +37 -24
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/constants.py +6 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/cursor.py +25 -9
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/network.py +29 -3
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/ocsp_snowflake.py +1 -1
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/pandas_tools.py +54 -8
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/secret_detector.py +2 -2
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/util_text.py +12 -7
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/version.py +1 -1
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake_connector_python.egg-info/PKG-INFO +11 -1
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake_connector_python.egg-info/SOURCES.txt +1 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/CONTRIBUTING.md +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/LICENSE.txt +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/MANIFEST.in +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/NOTICE +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/README.md +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/SECURITY.md +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/pyproject.toml +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/setup.cfg +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/setup.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/__init__.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/_query_context_cache.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/_sql_util.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/arrow_context.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/auth/__init__.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/auth/by_plugin.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/auth/default.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/auth/idtoken.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/auth/keypair.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/auth/oauth.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/auth/okta.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/auth/usrpwdmfa.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/auth/webbrowser.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/backoff_policies.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/cache.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/compat.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/config_manager.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/connection_diagnostic.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/converter.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/converter_issue23517.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/converter_null.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/converter_snowsql.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/dbapi.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/description.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/encryption_util.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/errorcode.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/errors.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/feature.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/file_compression_type.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/file_transfer_agent.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/file_util.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/gcs_storage_client.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/gzip_decoder.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/local_storage_client.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/log_configuration.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/ArrayConverter.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/ArrayConverter.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/BinaryConverter.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/BinaryConverter.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/BooleanConverter.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/BooleanConverter.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowChunkIterator.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowChunkIterator.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowIterator.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowIterator.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowTableIterator.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowTableIterator.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/DateConverter.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/DateConverter.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/DecimalConverter.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/DecimalConverter.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/FixedSizeListConverter.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/FixedSizeListConverter.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/FloatConverter.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/FloatConverter.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/IColumnConverter.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/IntConverter.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/IntConverter.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/LICENSE.txt +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/MapConverter.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/MapConverter.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/ObjectConverter.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/ObjectConverter.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Common.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Common.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Helpers.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Helpers.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/SnowflakeType.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/SnowflakeType.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/StringConverter.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/StringConverter.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeConverter.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeConverter.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeStampConverter.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeStampConverter.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/Util/macros.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/Util/time.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/Util/time.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_accessors.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_alloc.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_assert.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_builder.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_emitter.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_endian.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_epilogue.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_flatbuffers.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_identifier.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_iov.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_prologue.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_refmap.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_rtconfig.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_types.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_verifier.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/flatcc_portable.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/paligned_alloc.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pattributes.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic_pop.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic_push.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pendian.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pendian_detect.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pinline.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pinttypes.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/portable.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/portable_basic.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstatic_assert.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstdalign.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstdint.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/punaligned.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pversion.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pwarnings.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc.c +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow.c +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_arrow_iterator.pyx +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_device.c +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_device.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.c +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.h +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/Logging/logging.cpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/nanoarrow_cpp/Logging/logging.hpp +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/ocsp_asn1crypto.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/options.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/proxy.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/py.typed +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/result_batch.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/result_set.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/s3_storage_client.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/sf_dirs.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/sfbinaryformat.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/sfdatetime.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/snow_logging.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/sqlstate.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/ssd_internal_keys.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/ssl_wrap_socket.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/storage_client.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/telemetry.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/telemetry_oob.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/test_util.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/time_util.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/tool/__init__.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/tool/dump_certs.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/tool/dump_ocsp_response.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/tool/dump_ocsp_response_cache.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/tool/probe_connection.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/url_util.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/__init__.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/LICENSE +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/__init__.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/__version__.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/_internal_utils.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/adapters.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/api.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/auth.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/certs.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/compat.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/cookies.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/exceptions.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/help.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/hooks.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/models.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/sessions.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/status_codes.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/structures.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/requests/utils.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/LICENSE.txt +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/__init__.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/_collections.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/_version.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/connection.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/connectionpool.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/contrib/__init__.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/contrib/_appengine_environ.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/contrib/_securetransport/__init__.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/contrib/_securetransport/bindings.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/contrib/_securetransport/low_level.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/contrib/appengine.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/contrib/ntlmpool.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/contrib/pyopenssl.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/contrib/securetransport.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/contrib/socks.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/exceptions.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/fields.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/filepost.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/packages/__init__.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/packages/backports/__init__.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/packages/backports/makefile.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/packages/backports/weakref_finalize.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/packages/six.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/poolmanager.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/request.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/response.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/util/__init__.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/util/connection.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/util/proxy.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/util/queue.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/util/request.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/util/response.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/util/retry.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/util/ssl_.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/util/ssl_match_hostname.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/util/ssltransport.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/util/timeout.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/util/url.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake/connector/vendored/urllib3/util/wait.py +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake_connector_python.egg-info/dependency_links.txt +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake_connector_python.egg-info/entry_points.txt +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake_connector_python.egg-info/not-zip-safe +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake_connector_python.egg-info/requires.txt +0 -0
- {snowflake_connector_python-3.12.1 → snowflake_connector_python-3.12.3}/src/snowflake_connector_python.egg-info/top_level.txt +0 -0
|
@@ -8,6 +8,16 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne
|
|
|
8
8
|
|
|
9
9
|
# Release Notes
|
|
10
10
|
|
|
11
|
+
- v3.12.3(October 25,2024)
|
|
12
|
+
- Improved the error message for SSL-related issues to provide clearer guidance when an SSL error occurs.
|
|
13
|
+
- Improved error message for SQL execution cancellations caused by timeout.
|
|
14
|
+
|
|
15
|
+
- v3.12.2(September 11,2024)
|
|
16
|
+
- Improved error handling for asynchronous queries, providing more detailed and informative error messages when an async query fails.
|
|
17
|
+
- Improved inference of top-level domains for accounts specifying a region in China, now defaulting to snowflakecomputing.cn.
|
|
18
|
+
- Improved implementation of the `snowflake.connector.util_text.random_string` to reduce the likelihood of collisions.
|
|
19
|
+
- Updated the log level for OCSP fail-open warning messages from ERROR to WARNING.
|
|
20
|
+
|
|
11
21
|
- v3.12.1(August 20,2024)
|
|
12
22
|
- Fixed a bug that logged the session token when renewing a session.
|
|
13
23
|
- Fixed a bug where disabling client telemetry did not work.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: snowflake-connector-python
|
|
3
|
-
Version: 3.12.
|
|
3
|
+
Version: 3.12.3
|
|
4
4
|
Summary: Snowflake Connector for Python
|
|
5
5
|
Home-page: https://www.snowflake.com/
|
|
6
6
|
Author: Snowflake, Inc
|
|
@@ -85,6 +85,16 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne
|
|
|
85
85
|
|
|
86
86
|
# Release Notes
|
|
87
87
|
|
|
88
|
+
- v3.12.3(October 25,2024)
|
|
89
|
+
- Improved the error message for SSL-related issues to provide clearer guidance when an SSL error occurs.
|
|
90
|
+
- Improved error message for SQL execution cancellations caused by timeout.
|
|
91
|
+
|
|
92
|
+
- v3.12.2(September 11,2024)
|
|
93
|
+
- Improved error handling for asynchronous queries, providing more detailed and informative error messages when an async query fails.
|
|
94
|
+
- Improved inference of top-level domains for accounts specifying a region in China, now defaulting to snowflakecomputing.cn.
|
|
95
|
+
- Improved implementation of the `snowflake.connector.util_text.random_string` to reduce the likelihood of collisions.
|
|
96
|
+
- Updated the log level for OCSP fail-open warning messages from ERROR to WARNING.
|
|
97
|
+
|
|
88
98
|
- v3.12.1(August 20,2024)
|
|
89
99
|
- Fixed a bug that logged the session token when renewing a session.
|
|
90
100
|
- Fixed a bug where disabling client telemetry did not work.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
|
|
3
|
+
#
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import string
|
|
8
|
+
from enum import Enum
|
|
9
|
+
from random import choice
|
|
10
|
+
from threading import Timer
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class TempObjectType(Enum):
|
|
14
|
+
TABLE = "TABLE"
|
|
15
|
+
VIEW = "VIEW"
|
|
16
|
+
STAGE = "STAGE"
|
|
17
|
+
FUNCTION = "FUNCTION"
|
|
18
|
+
FILE_FORMAT = "FILE_FORMAT"
|
|
19
|
+
QUERY_TAG = "QUERY_TAG"
|
|
20
|
+
COLUMN = "COLUMN"
|
|
21
|
+
PROCEDURE = "PROCEDURE"
|
|
22
|
+
TABLE_FUNCTION = "TABLE_FUNCTION"
|
|
23
|
+
DYNAMIC_TABLE = "DYNAMIC_TABLE"
|
|
24
|
+
AGGREGATE_FUNCTION = "AGGREGATE_FUNCTION"
|
|
25
|
+
CTE = "CTE"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
TEMP_OBJECT_NAME_PREFIX = "SNOWPARK_TEMP_"
|
|
29
|
+
ALPHANUMERIC = string.digits + string.ascii_lowercase
|
|
30
|
+
TEMPORARY_STRING = "TEMP"
|
|
31
|
+
SCOPED_TEMPORARY_STRING = "SCOPED TEMPORARY"
|
|
32
|
+
_PYTHON_SNOWPARK_USE_SCOPED_TEMP_OBJECTS_STRING = (
|
|
33
|
+
"PYTHON_SNOWPARK_USE_SCOPED_TEMP_OBJECTS"
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def generate_random_alphanumeric(length: int = 10) -> str:
|
|
38
|
+
return "".join(choice(ALPHANUMERIC) for _ in range(length))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def random_name_for_temp_object(object_type: TempObjectType) -> str:
|
|
42
|
+
return f"{TEMP_OBJECT_NAME_PREFIX}{object_type.value}_{generate_random_alphanumeric().upper()}"
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def get_temp_type_for_object(use_scoped_temp_objects: bool) -> str:
|
|
46
|
+
return SCOPED_TEMPORARY_STRING if use_scoped_temp_objects else TEMPORARY_STRING
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class _TrackedQueryCancellationTimer(Timer):
|
|
50
|
+
def __init__(self, interval, function, args=None, kwargs=None):
|
|
51
|
+
super().__init__(interval, function, args, kwargs)
|
|
52
|
+
self.executed = False
|
|
53
|
+
|
|
54
|
+
def run(self):
|
|
55
|
+
super().run()
|
|
56
|
+
self.executed = True
|
|
@@ -112,6 +112,18 @@ KEYRING_DRIVER_NAME = "SNOWFLAKE-PYTHON-DRIVER"
|
|
|
112
112
|
ID_TOKEN = "ID_TOKEN"
|
|
113
113
|
MFA_TOKEN = "MFATOKEN"
|
|
114
114
|
|
|
115
|
+
AUTHENTICATION_REQUEST_KEY_WHITELIST = {
|
|
116
|
+
"ACCOUNT_NAME",
|
|
117
|
+
"AUTHENTICATOR",
|
|
118
|
+
"CLIENT_APP_ID",
|
|
119
|
+
"CLIENT_APP_VERSION",
|
|
120
|
+
"CLIENT_ENVIRONMENT",
|
|
121
|
+
"EXT_AUTHN_DUO_METHOD",
|
|
122
|
+
"LOGIN_NAME",
|
|
123
|
+
"SESSION_PARAMETERS",
|
|
124
|
+
"SVN_REVISION",
|
|
125
|
+
}
|
|
126
|
+
|
|
115
127
|
|
|
116
128
|
class Auth:
|
|
117
129
|
"""Snowflake Authenticator."""
|
|
@@ -205,7 +217,6 @@ class Auth:
|
|
|
205
217
|
|
|
206
218
|
body = copy.deepcopy(body_template)
|
|
207
219
|
# updating request body
|
|
208
|
-
logger.debug("assertion content: %s", auth_instance.assertion_content)
|
|
209
220
|
auth_instance.update_body(body)
|
|
210
221
|
|
|
211
222
|
logger.debug(
|
|
@@ -243,7 +254,10 @@ class Auth:
|
|
|
243
254
|
|
|
244
255
|
logger.debug(
|
|
245
256
|
"body['data']: %s",
|
|
246
|
-
{
|
|
257
|
+
{
|
|
258
|
+
k: v if k in AUTHENTICATION_REQUEST_KEY_WHITELIST else "******"
|
|
259
|
+
for (k, v) in body["data"].items()
|
|
260
|
+
},
|
|
247
261
|
)
|
|
248
262
|
|
|
249
263
|
try:
|
|
@@ -8,7 +8,7 @@ import json
|
|
|
8
8
|
import os
|
|
9
9
|
import xml.etree.ElementTree as ET
|
|
10
10
|
from datetime import datetime, timezone
|
|
11
|
-
from logging import getLogger
|
|
11
|
+
from logging import Filter, getLogger
|
|
12
12
|
from random import choice
|
|
13
13
|
from string import hexdigits
|
|
14
14
|
from typing import TYPE_CHECKING, Any, NamedTuple
|
|
@@ -39,6 +39,22 @@ ENCRYPTION_DATA = "x-ms-meta-encryptiondata"
|
|
|
39
39
|
MATDESC = "x-ms-meta-matdesc"
|
|
40
40
|
|
|
41
41
|
|
|
42
|
+
class AzureCredentialFilter(Filter):
|
|
43
|
+
LEAKY_FMT = '%s://%s:%s "%s %s %s" %s %s'
|
|
44
|
+
|
|
45
|
+
def filter(self, record):
|
|
46
|
+
if record.msg == AzureCredentialFilter.LEAKY_FMT and len(record.args) == 8:
|
|
47
|
+
record.args = (
|
|
48
|
+
record.args[:4] + (record.args[4].split("?")[0],) + record.args[5:]
|
|
49
|
+
)
|
|
50
|
+
return True
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
getLogger("snowflake.connector.vendored.urllib3.connectionpool").addFilter(
|
|
54
|
+
AzureCredentialFilter()
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
42
58
|
class SnowflakeAzureRestClient(SnowflakeStorageClient):
|
|
43
59
|
def __init__(
|
|
44
60
|
self,
|
|
@@ -10,6 +10,10 @@ from io import BytesIO
|
|
|
10
10
|
from logging import getLogger
|
|
11
11
|
from typing import TYPE_CHECKING
|
|
12
12
|
|
|
13
|
+
from ._utils import (
|
|
14
|
+
_PYTHON_SNOWPARK_USE_SCOPED_TEMP_OBJECTS_STRING,
|
|
15
|
+
get_temp_type_for_object,
|
|
16
|
+
)
|
|
13
17
|
from .errors import BindUploadError, Error
|
|
14
18
|
|
|
15
19
|
if TYPE_CHECKING: # pragma: no cover
|
|
@@ -19,11 +23,6 @@ logger = getLogger(__name__)
|
|
|
19
23
|
|
|
20
24
|
|
|
21
25
|
class BindUploadAgent:
|
|
22
|
-
_STAGE_NAME = "SYSTEMBIND"
|
|
23
|
-
_CREATE_STAGE_STMT = (
|
|
24
|
-
f"create or replace temporary stage {_STAGE_NAME} "
|
|
25
|
-
"file_format=(type=csv field_optionally_enclosed_by='\"')"
|
|
26
|
-
)
|
|
27
26
|
|
|
28
27
|
def __init__(
|
|
29
28
|
self,
|
|
@@ -38,13 +37,27 @@ class BindUploadAgent:
|
|
|
38
37
|
rows: Rows of binding parameters in CSV format.
|
|
39
38
|
stream_buffer_size: Size of each file, default to 10MB.
|
|
40
39
|
"""
|
|
40
|
+
self._use_scoped_temp_object = (
|
|
41
|
+
cursor.connection._session_parameters.get(
|
|
42
|
+
_PYTHON_SNOWPARK_USE_SCOPED_TEMP_OBJECTS_STRING, False
|
|
43
|
+
)
|
|
44
|
+
if cursor.connection._session_parameters
|
|
45
|
+
else False
|
|
46
|
+
)
|
|
47
|
+
self._STAGE_NAME = (
|
|
48
|
+
"SNOWPARK_TEMP_STAGE_BIND" if self._use_scoped_temp_object else "SYSTEMBIND"
|
|
49
|
+
)
|
|
41
50
|
self.cursor = cursor
|
|
42
51
|
self.rows = rows
|
|
43
52
|
self._stream_buffer_size = stream_buffer_size
|
|
44
53
|
self.stage_path = f"@{self._STAGE_NAME}/{uuid.uuid4().hex}"
|
|
45
54
|
|
|
46
55
|
def _create_stage(self) -> None:
|
|
47
|
-
|
|
56
|
+
create_stage_sql = (
|
|
57
|
+
f"create or replace {get_temp_type_for_object(self._use_scoped_temp_object)} stage {self._STAGE_NAME} "
|
|
58
|
+
"file_format=(type=csv field_optionally_enclosed_by='\"')"
|
|
59
|
+
)
|
|
60
|
+
self.cursor.execute(create_stage_sql)
|
|
48
61
|
|
|
49
62
|
def upload(self) -> None:
|
|
50
63
|
try:
|
|
@@ -52,6 +52,7 @@ from .compat import IS_LINUX, IS_WINDOWS, quote, urlencode
|
|
|
52
52
|
from .config_manager import CONFIG_MANAGER, _get_default_connection_params
|
|
53
53
|
from .connection_diagnostic import ConnectionDiagnostic
|
|
54
54
|
from .constants import (
|
|
55
|
+
_CONNECTIVITY_ERR_MSG,
|
|
55
56
|
_DOMAIN_NAME_MAP,
|
|
56
57
|
ENV_VAR_PARTNER,
|
|
57
58
|
PARAMETER_AUTOCOMMIT,
|
|
@@ -1455,6 +1456,8 @@ class SnowflakeConnection:
|
|
|
1455
1456
|
)
|
|
1456
1457
|
except OperationalError as auth_op:
|
|
1457
1458
|
if auth_op.errno == ER_FAILED_TO_CONNECT_TO_DB:
|
|
1459
|
+
if _CONNECTIVITY_ERR_MSG in e.msg:
|
|
1460
|
+
auth_op.msg += f"\n{_CONNECTIVITY_ERR_MSG}"
|
|
1458
1461
|
raise auth_op from e
|
|
1459
1462
|
logger.debug("Continuing authenticator specific timeout handling")
|
|
1460
1463
|
continue
|
|
@@ -1817,6 +1820,39 @@ class SnowflakeConnection:
|
|
|
1817
1820
|
with suppress(Exception):
|
|
1818
1821
|
self.close(retry=False)
|
|
1819
1822
|
|
|
1823
|
+
def _process_error_query_status(
|
|
1824
|
+
self,
|
|
1825
|
+
sf_qid: str,
|
|
1826
|
+
status_resp: dict,
|
|
1827
|
+
error_message: str = "",
|
|
1828
|
+
error_cls: type[Exception] = ProgrammingError,
|
|
1829
|
+
) -> None:
|
|
1830
|
+
status_resp = status_resp or {}
|
|
1831
|
+
data = status_resp.get("data", {})
|
|
1832
|
+
queries = data.get("queries")
|
|
1833
|
+
|
|
1834
|
+
if sf_qid in self._async_sfqids:
|
|
1835
|
+
self._async_sfqids.pop(sf_qid, None)
|
|
1836
|
+
message = status_resp.get("message")
|
|
1837
|
+
if message is None:
|
|
1838
|
+
message = ""
|
|
1839
|
+
code = queries[0].get("errorCode", -1) if queries else -1
|
|
1840
|
+
sql_state = None
|
|
1841
|
+
if "data" in status_resp:
|
|
1842
|
+
message += queries[0].get("errorMessage", "") if queries else ""
|
|
1843
|
+
sql_state = data.get("sqlState")
|
|
1844
|
+
Error.errorhandler_wrapper(
|
|
1845
|
+
self,
|
|
1846
|
+
None,
|
|
1847
|
+
error_cls,
|
|
1848
|
+
{
|
|
1849
|
+
"msg": message or error_message,
|
|
1850
|
+
"errno": int(code),
|
|
1851
|
+
"sqlstate": sql_state,
|
|
1852
|
+
"sfqid": sf_qid,
|
|
1853
|
+
},
|
|
1854
|
+
)
|
|
1855
|
+
|
|
1820
1856
|
def get_query_status(self, sf_qid: str) -> QueryStatus:
|
|
1821
1857
|
"""Retrieves the status of query with sf_qid.
|
|
1822
1858
|
|
|
@@ -1845,31 +1881,8 @@ class SnowflakeConnection:
|
|
|
1845
1881
|
"""
|
|
1846
1882
|
status, status_resp = self._get_query_status(sf_qid)
|
|
1847
1883
|
self._cache_query_status(sf_qid, status)
|
|
1848
|
-
queries = status_resp["data"]["queries"]
|
|
1849
1884
|
if self.is_an_error(status):
|
|
1850
|
-
|
|
1851
|
-
self._async_sfqids.pop(sf_qid, None)
|
|
1852
|
-
message = status_resp.get("message")
|
|
1853
|
-
if message is None:
|
|
1854
|
-
message = ""
|
|
1855
|
-
code = queries[0].get("errorCode", -1)
|
|
1856
|
-
sql_state = None
|
|
1857
|
-
if "data" in status_resp:
|
|
1858
|
-
message += (
|
|
1859
|
-
queries[0].get("errorMessage", "") if len(queries) > 0 else ""
|
|
1860
|
-
)
|
|
1861
|
-
sql_state = status_resp["data"].get("sqlState")
|
|
1862
|
-
Error.errorhandler_wrapper(
|
|
1863
|
-
self,
|
|
1864
|
-
None,
|
|
1865
|
-
ProgrammingError,
|
|
1866
|
-
{
|
|
1867
|
-
"msg": message,
|
|
1868
|
-
"errno": int(code),
|
|
1869
|
-
"sqlstate": sql_state,
|
|
1870
|
-
"sfqid": sf_qid,
|
|
1871
|
-
},
|
|
1872
|
-
)
|
|
1885
|
+
self._process_error_query_status(sf_qid, status_resp)
|
|
1873
1886
|
return status
|
|
1874
1887
|
|
|
1875
1888
|
def initialize_query_context_cache(self) -> None:
|
|
@@ -428,3 +428,9 @@ ENV_VAR_TEST_MODE = "SNOWFLAKE_TEST_MODE"
|
|
|
428
428
|
|
|
429
429
|
|
|
430
430
|
_DOMAIN_NAME_MAP = {_DEFAULT_HOSTNAME_TLD: "GLOBAL", _CHINA_HOSTNAME_TLD: "CHINA"}
|
|
431
|
+
|
|
432
|
+
_CONNECTIVITY_ERR_MSG = (
|
|
433
|
+
"Verify that the hostnames and port numbers in SYSTEM$ALLOWLIST are added to your firewall's allowed list."
|
|
434
|
+
"\nTo further troubleshoot your connection you may reference the following article: "
|
|
435
|
+
"https://docs.snowflake.com/en/user-guide/client-connectivity-troubleshooting/overview."
|
|
436
|
+
)
|
|
@@ -16,7 +16,7 @@ import uuid
|
|
|
16
16
|
import warnings
|
|
17
17
|
from enum import Enum
|
|
18
18
|
from logging import getLogger
|
|
19
|
-
from threading import Lock
|
|
19
|
+
from threading import Lock
|
|
20
20
|
from types import TracebackType
|
|
21
21
|
from typing import (
|
|
22
22
|
IO,
|
|
@@ -39,6 +39,7 @@ from snowflake.connector.result_set import ResultSet
|
|
|
39
39
|
|
|
40
40
|
from . import compat
|
|
41
41
|
from ._sql_util import get_file_transfer_type
|
|
42
|
+
from ._utils import _TrackedQueryCancellationTimer
|
|
42
43
|
from .bind_upload_agent import BindUploadAgent, BindUploadError
|
|
43
44
|
from .constants import (
|
|
44
45
|
FIELD_NAME_TO_ID,
|
|
@@ -392,7 +393,9 @@ class SnowflakeCursor:
|
|
|
392
393
|
self.messages: list[
|
|
393
394
|
tuple[type[Error] | type[Exception], dict[str, str | bool]]
|
|
394
395
|
] = []
|
|
395
|
-
self._timebomb:
|
|
396
|
+
self._timebomb: _TrackedQueryCancellationTimer | None = (
|
|
397
|
+
None # must be here for abort_exit method
|
|
398
|
+
)
|
|
396
399
|
self._description: list[ResultMetadataV2] | None = None
|
|
397
400
|
self._sfqid: str | None = None
|
|
398
401
|
self._sqlstate = None
|
|
@@ -654,7 +657,9 @@ class SnowflakeCursor:
|
|
|
654
657
|
)
|
|
655
658
|
|
|
656
659
|
if real_timeout is not None:
|
|
657
|
-
self._timebomb =
|
|
660
|
+
self._timebomb = _TrackedQueryCancellationTimer(
|
|
661
|
+
real_timeout, self.__cancel_query, [query]
|
|
662
|
+
)
|
|
658
663
|
self._timebomb.start()
|
|
659
664
|
logger.debug("started timebomb in %ss", real_timeout)
|
|
660
665
|
else:
|
|
@@ -1071,6 +1076,11 @@ class SnowflakeCursor:
|
|
|
1071
1076
|
logger.debug(ret)
|
|
1072
1077
|
err = ret["message"]
|
|
1073
1078
|
code = ret.get("code", -1)
|
|
1079
|
+
if self._timebomb and self._timebomb.executed:
|
|
1080
|
+
err = (
|
|
1081
|
+
f"SQL execution was cancelled by the client due to a timeout. "
|
|
1082
|
+
f"Error message received from the server: {err}"
|
|
1083
|
+
)
|
|
1074
1084
|
if "data" in ret:
|
|
1075
1085
|
err += ret["data"].get("errorMessage", "")
|
|
1076
1086
|
errvalue = {
|
|
@@ -1238,6 +1248,7 @@ class SnowflakeCursor:
|
|
|
1238
1248
|
)
|
|
1239
1249
|
|
|
1240
1250
|
def query_result(self, qid: str) -> SnowflakeCursor:
|
|
1251
|
+
"""Query the result of a previously executed query."""
|
|
1241
1252
|
url = f"/queries/{qid}/result"
|
|
1242
1253
|
ret = self._connection.rest.request(url=url, method="get")
|
|
1243
1254
|
self._sfqid = (
|
|
@@ -1631,14 +1642,17 @@ class SnowflakeCursor:
|
|
|
1631
1642
|
self.close()
|
|
1632
1643
|
|
|
1633
1644
|
def get_results_from_sfqid(self, sfqid: str) -> None:
|
|
1634
|
-
"""Gets the results from previously ran query.
|
|
1645
|
+
"""Gets the results from previously ran query. This methods differs from ``SnowflakeCursor.query_result``
|
|
1646
|
+
in that it monitors the ``sfqid`` until it is no longer running, and then retrieves the results.
|
|
1647
|
+
"""
|
|
1635
1648
|
|
|
1636
1649
|
def wait_until_ready() -> None:
|
|
1637
1650
|
"""Makes sure query has finished executing and once it has retrieves results."""
|
|
1638
1651
|
no_data_counter = 0
|
|
1639
1652
|
retry_pattern_pos = 0
|
|
1640
1653
|
while True:
|
|
1641
|
-
status = self.connection.
|
|
1654
|
+
status, status_resp = self.connection._get_query_status(sfqid)
|
|
1655
|
+
self.connection._cache_query_status(sfqid, status)
|
|
1642
1656
|
if not self.connection.is_still_running(status):
|
|
1643
1657
|
break
|
|
1644
1658
|
if status == QueryStatus.NO_DATA: # pragma: no cover
|
|
@@ -1655,10 +1669,12 @@ class SnowflakeCursor:
|
|
|
1655
1669
|
if retry_pattern_pos < (len(ASYNC_RETRY_PATTERN) - 1):
|
|
1656
1670
|
retry_pattern_pos += 1
|
|
1657
1671
|
if status != QueryStatus.SUCCESS:
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1672
|
+
logger.info(f"Status of query '{sfqid}' is {status.name}")
|
|
1673
|
+
self.connection._process_error_query_status(
|
|
1674
|
+
sfqid,
|
|
1675
|
+
status_resp,
|
|
1676
|
+
error_message=f"Status of query '{sfqid}' is {status.name}, results are unavailable",
|
|
1677
|
+
error_cls=DatabaseError,
|
|
1662
1678
|
)
|
|
1663
1679
|
self._inner_cursor.execute(f"select * from table(result_scan('{sfqid}'))")
|
|
1664
1680
|
self._result = self._inner_cursor._result
|
|
@@ -46,6 +46,7 @@ from .compat import (
|
|
|
46
46
|
urlparse,
|
|
47
47
|
)
|
|
48
48
|
from .constants import (
|
|
49
|
+
_CONNECTIVITY_ERR_MSG,
|
|
49
50
|
_SNOWFLAKE_HOST_SUFFIX_REGEX,
|
|
50
51
|
HTTP_HEADER_ACCEPT,
|
|
51
52
|
HTTP_HEADER_CONTENT_TYPE,
|
|
@@ -892,6 +893,14 @@ class SnowflakeRestful:
|
|
|
892
893
|
full_url = retry_ctx.add_retry_params(full_url)
|
|
893
894
|
full_url = SnowflakeRestful.add_request_guid(full_url)
|
|
894
895
|
is_fetch_query_status = kwargs.pop("is_fetch_query_status", False)
|
|
896
|
+
# raise_raw_http_failure is not a public parameter and may change in the future
|
|
897
|
+
# it enables raising raw http errors that are not handled by
|
|
898
|
+
# connector, connector handles the following http error:
|
|
899
|
+
# 1. FORBIDDEN error when trying to login
|
|
900
|
+
# 2. retryable http code defined in method is_retryable_http_code
|
|
901
|
+
# 3. UNAUTHORIZED error when using okta authentication
|
|
902
|
+
# raise_raw_http_failure doesn't work for the 3 mentioned cases.
|
|
903
|
+
raise_raw_http_failure = kwargs.pop("raise_raw_http_failure", False)
|
|
895
904
|
try:
|
|
896
905
|
return_object = self._request_exec(
|
|
897
906
|
session=session,
|
|
@@ -900,6 +909,7 @@ class SnowflakeRestful:
|
|
|
900
909
|
headers=headers,
|
|
901
910
|
data=data,
|
|
902
911
|
token=token,
|
|
912
|
+
raise_raw_http_failure=raise_raw_http_failure,
|
|
903
913
|
**kwargs,
|
|
904
914
|
)
|
|
905
915
|
if return_object is not None:
|
|
@@ -967,7 +977,9 @@ class SnowflakeRestful:
|
|
|
967
977
|
)
|
|
968
978
|
return None # retry
|
|
969
979
|
except Exception as e:
|
|
970
|
-
if
|
|
980
|
+
if (
|
|
981
|
+
raise_raw_http_failure and isinstance(e, requests.exceptions.HTTPError)
|
|
982
|
+
) or not no_retry:
|
|
971
983
|
raise e
|
|
972
984
|
logger.debug("Ignored error", exc_info=True)
|
|
973
985
|
return {}
|
|
@@ -1036,6 +1048,7 @@ class SnowflakeRestful:
|
|
|
1036
1048
|
binary_data_handler=None,
|
|
1037
1049
|
socket_timeout: int | None = None,
|
|
1038
1050
|
is_okta_authentication: bool = False,
|
|
1051
|
+
raise_raw_http_failure: bool = False,
|
|
1039
1052
|
):
|
|
1040
1053
|
if socket_timeout is None:
|
|
1041
1054
|
if self._connection.socket_timeout is not None:
|
|
@@ -1113,6 +1126,8 @@ class SnowflakeRestful:
|
|
|
1113
1126
|
raise_okta_unauthorized_error(self._connection, raw_ret)
|
|
1114
1127
|
return None # required for tests
|
|
1115
1128
|
else:
|
|
1129
|
+
if raise_raw_http_failure:
|
|
1130
|
+
raw_ret.raise_for_status()
|
|
1116
1131
|
raise_failed_request_error(
|
|
1117
1132
|
self._connection, full_url, method, raw_ret
|
|
1118
1133
|
)
|
|
@@ -1120,8 +1135,19 @@ class SnowflakeRestful:
|
|
|
1120
1135
|
finally:
|
|
1121
1136
|
raw_ret.close() # ensure response is closed
|
|
1122
1137
|
except SSLError as se:
|
|
1123
|
-
|
|
1124
|
-
|
|
1138
|
+
msg = f"Hit non-retryable SSL error, {str(se)}.\n{_CONNECTIVITY_ERR_MSG}"
|
|
1139
|
+
logger.debug(msg)
|
|
1140
|
+
# the following code is for backward compatibility with old versions of python connector which calls
|
|
1141
|
+
# self._handle_unknown_error to process SSLError
|
|
1142
|
+
Error.errorhandler_wrapper(
|
|
1143
|
+
self._connection,
|
|
1144
|
+
None,
|
|
1145
|
+
OperationalError,
|
|
1146
|
+
{
|
|
1147
|
+
"msg": msg,
|
|
1148
|
+
"errno": ER_FAILED_TO_REQUEST,
|
|
1149
|
+
},
|
|
1150
|
+
)
|
|
1125
1151
|
except (
|
|
1126
1152
|
BadStatusLine,
|
|
1127
1153
|
ConnectionError,
|
|
@@ -26,6 +26,12 @@ from snowflake.connector.options import pandas
|
|
|
26
26
|
from snowflake.connector.telemetry import TelemetryData, TelemetryField
|
|
27
27
|
from snowflake.connector.util_text import random_string
|
|
28
28
|
|
|
29
|
+
from ._utils import (
|
|
30
|
+
_PYTHON_SNOWPARK_USE_SCOPED_TEMP_OBJECTS_STRING,
|
|
31
|
+
TempObjectType,
|
|
32
|
+
get_temp_type_for_object,
|
|
33
|
+
random_name_for_temp_object,
|
|
34
|
+
)
|
|
29
35
|
from .cursor import SnowflakeCursor
|
|
30
36
|
|
|
31
37
|
if TYPE_CHECKING: # pragma: no cover
|
|
@@ -77,8 +83,9 @@ def _do_create_temp_stage(
|
|
|
77
83
|
compression: str,
|
|
78
84
|
auto_create_table: bool,
|
|
79
85
|
overwrite: bool,
|
|
86
|
+
use_scoped_temp_object: bool,
|
|
80
87
|
) -> None:
|
|
81
|
-
create_stage_sql = f"CREATE
|
|
88
|
+
create_stage_sql = f"CREATE {get_temp_type_for_object(use_scoped_temp_object)} STAGE /* Python:snowflake.connector.pandas_tools.write_pandas() */ {stage_location} FILE_FORMAT=(TYPE=PARQUET COMPRESSION={compression}{' BINARY_AS_TEXT=FALSE' if auto_create_table or overwrite else ''})"
|
|
82
89
|
logger.debug(f"creating stage with '{create_stage_sql}'")
|
|
83
90
|
cursor.execute(create_stage_sql, _is_internal=True).fetchall()
|
|
84
91
|
|
|
@@ -91,8 +98,13 @@ def _create_temp_stage(
|
|
|
91
98
|
compression: str,
|
|
92
99
|
auto_create_table: bool,
|
|
93
100
|
overwrite: bool,
|
|
101
|
+
use_scoped_temp_object: bool = False,
|
|
94
102
|
) -> str:
|
|
95
|
-
stage_name =
|
|
103
|
+
stage_name = (
|
|
104
|
+
random_name_for_temp_object(TempObjectType.STAGE)
|
|
105
|
+
if use_scoped_temp_object
|
|
106
|
+
else random_string()
|
|
107
|
+
)
|
|
96
108
|
stage_location = build_location_helper(
|
|
97
109
|
database=database,
|
|
98
110
|
schema=schema,
|
|
@@ -101,7 +113,12 @@ def _create_temp_stage(
|
|
|
101
113
|
)
|
|
102
114
|
try:
|
|
103
115
|
_do_create_temp_stage(
|
|
104
|
-
cursor,
|
|
116
|
+
cursor,
|
|
117
|
+
stage_location,
|
|
118
|
+
compression,
|
|
119
|
+
auto_create_table,
|
|
120
|
+
overwrite,
|
|
121
|
+
use_scoped_temp_object,
|
|
105
122
|
)
|
|
106
123
|
except ProgrammingError as e:
|
|
107
124
|
# User may not have the privilege to create stage on the target schema, so fall back to use current schema as
|
|
@@ -111,7 +128,12 @@ def _create_temp_stage(
|
|
|
111
128
|
)
|
|
112
129
|
stage_location = stage_name
|
|
113
130
|
_do_create_temp_stage(
|
|
114
|
-
cursor,
|
|
131
|
+
cursor,
|
|
132
|
+
stage_location,
|
|
133
|
+
compression,
|
|
134
|
+
auto_create_table,
|
|
135
|
+
overwrite,
|
|
136
|
+
use_scoped_temp_object,
|
|
115
137
|
)
|
|
116
138
|
|
|
117
139
|
return stage_location
|
|
@@ -122,9 +144,10 @@ def _do_create_temp_file_format(
|
|
|
122
144
|
file_format_location: str,
|
|
123
145
|
compression: str,
|
|
124
146
|
sql_use_logical_type: str,
|
|
147
|
+
use_scoped_temp_object: bool,
|
|
125
148
|
) -> None:
|
|
126
149
|
file_format_sql = (
|
|
127
|
-
f"CREATE
|
|
150
|
+
f"CREATE {get_temp_type_for_object(use_scoped_temp_object)} FILE FORMAT {file_format_location} "
|
|
128
151
|
f"/* Python:snowflake.connector.pandas_tools.write_pandas() */ "
|
|
129
152
|
f"TYPE=PARQUET COMPRESSION={compression}{sql_use_logical_type}"
|
|
130
153
|
)
|
|
@@ -139,8 +162,13 @@ def _create_temp_file_format(
|
|
|
139
162
|
quote_identifiers: bool,
|
|
140
163
|
compression: str,
|
|
141
164
|
sql_use_logical_type: str,
|
|
165
|
+
use_scoped_temp_object: bool = False,
|
|
142
166
|
) -> str:
|
|
143
|
-
file_format_name =
|
|
167
|
+
file_format_name = (
|
|
168
|
+
random_name_for_temp_object(TempObjectType.FILE_FORMAT)
|
|
169
|
+
if use_scoped_temp_object
|
|
170
|
+
else random_string()
|
|
171
|
+
)
|
|
144
172
|
file_format_location = build_location_helper(
|
|
145
173
|
database=database,
|
|
146
174
|
schema=schema,
|
|
@@ -149,7 +177,11 @@ def _create_temp_file_format(
|
|
|
149
177
|
)
|
|
150
178
|
try:
|
|
151
179
|
_do_create_temp_file_format(
|
|
152
|
-
cursor,
|
|
180
|
+
cursor,
|
|
181
|
+
file_format_location,
|
|
182
|
+
compression,
|
|
183
|
+
sql_use_logical_type,
|
|
184
|
+
use_scoped_temp_object,
|
|
153
185
|
)
|
|
154
186
|
except ProgrammingError as e:
|
|
155
187
|
# User may not have the privilege to create file format on the target schema, so fall back to use current schema
|
|
@@ -159,7 +191,11 @@ def _create_temp_file_format(
|
|
|
159
191
|
)
|
|
160
192
|
file_format_location = file_format_name
|
|
161
193
|
_do_create_temp_file_format(
|
|
162
|
-
cursor,
|
|
194
|
+
cursor,
|
|
195
|
+
file_format_location,
|
|
196
|
+
compression,
|
|
197
|
+
sql_use_logical_type,
|
|
198
|
+
use_scoped_temp_object,
|
|
163
199
|
)
|
|
164
200
|
|
|
165
201
|
return file_format_location
|
|
@@ -263,6 +299,14 @@ def write_pandas(
|
|
|
263
299
|
f"Invalid compression '{compression}', only acceptable values are: {compression_map.keys()}"
|
|
264
300
|
)
|
|
265
301
|
|
|
302
|
+
_use_scoped_temp_object = (
|
|
303
|
+
conn._session_parameters.get(
|
|
304
|
+
_PYTHON_SNOWPARK_USE_SCOPED_TEMP_OBJECTS_STRING, False
|
|
305
|
+
)
|
|
306
|
+
if conn._session_parameters
|
|
307
|
+
else False
|
|
308
|
+
)
|
|
309
|
+
|
|
266
310
|
if create_temp_table:
|
|
267
311
|
warnings.warn(
|
|
268
312
|
"create_temp_table is deprecated, we still respect this parameter when it is True but "
|
|
@@ -324,6 +368,7 @@ def write_pandas(
|
|
|
324
368
|
compression,
|
|
325
369
|
auto_create_table,
|
|
326
370
|
overwrite,
|
|
371
|
+
_use_scoped_temp_object,
|
|
327
372
|
)
|
|
328
373
|
|
|
329
374
|
with TemporaryDirectory() as tmp_folder:
|
|
@@ -370,6 +415,7 @@ def write_pandas(
|
|
|
370
415
|
quote_identifiers,
|
|
371
416
|
compression_map[compression],
|
|
372
417
|
sql_use_logical_type,
|
|
418
|
+
_use_scoped_temp_object,
|
|
373
419
|
)
|
|
374
420
|
infer_schema_sql = f"SELECT COLUMN_NAME, TYPE FROM table(infer_schema(location=>'@{stage_location}', file_format=>'{file_format_location}'))"
|
|
375
421
|
logger.debug(f"inferring schema with '{infer_schema_sql}'")
|
|
@@ -33,14 +33,14 @@ class SecretDetector(logging.Formatter):
|
|
|
33
33
|
flags=re.IGNORECASE,
|
|
34
34
|
)
|
|
35
35
|
PRIVATE_KEY_PATTERN = re.compile(
|
|
36
|
-
r"
|
|
36
|
+
r"-{3,}BEGIN [A-Z ]*PRIVATE KEY-{3,}\n([\s\S]*?)\n-{3,}END [A-Z ]*PRIVATE KEY-{3,}",
|
|
37
37
|
flags=re.MULTILINE | re.IGNORECASE,
|
|
38
38
|
)
|
|
39
39
|
PRIVATE_KEY_DATA_PATTERN = re.compile(
|
|
40
40
|
r'"privateKeyData": "([a-z0-9/+=\\n]{10,})"', flags=re.MULTILINE | re.IGNORECASE
|
|
41
41
|
)
|
|
42
42
|
CONNECTION_TOKEN_PATTERN = re.compile(
|
|
43
|
-
r"(token|assertion content)" r"([\'\"\s:=]+)" r"([a-z0-9=/_
|
|
43
|
+
r"(token|assertion content)" r"([\'\"\s:=]+)" r"([a-z0-9=/_\-\+\.]{8,})",
|
|
44
44
|
flags=re.IGNORECASE,
|
|
45
45
|
)
|
|
46
46
|
|