snowflakedb / snowpark-python

Snowflake Snowpark Python API
Apache License 2.0
243 stars 101 forks source link

SNOW-721395: object_construct in snowpark behaves different from snowflake sql #647

Closed RalfKow closed 1 year ago

RalfKow commented 1 year ago

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using?

    Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]

  2. What operating system and processor architecture are you using?

    poetry

  3. What are the component versions in the environment (pip freeze)?

    [[package]] name = "asn1crypto" version = "1.5.1" description = "Fast ASN.1 parser and serializer with definitions for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8, PKCS#12, PKCS#5, X.509 and TSP" category = "main" optional = false python-versions = "*"

    [[package]] name = "astroid" version = "2.12.13" description = "An abstract syntax tree for Python with inference support." category = "dev" optional = false python-versions = ">=3.7.2"

    [package.dependencies] lazy-object-proxy = ">=1.4.0" typing-extensions = {version = ">=3.10", markers = "python_version < \"3.10\""} wrapt = {version = ">=1.11,<2", markers = "python_version < \"3.11\""}

    [[package]] name = "attrs" version = "22.2.0" description = "Classes Without Boilerplate" category = "dev" optional = false python-versions = ">=3.6"

    [package.extras] cov = ["attrs[tests]", "coverage-enable-subprocess", "coverage[toml] (>=5.3)"] dev = ["attrs[docs,tests]"] docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope.interface"] tests = ["attrs[tests-no-zope]", "zope.interface"] tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=0.971,<0.990)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] tests_no_zope = ["cloudpickle", "hypothesis", "mypy (>=0.971,<0.990)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"]

    [[package]] name = "azure-core" version = "1.26.1" description = "Microsoft Azure Core Library for Python" category = "main" optional = false python-versions = ">=3.7"

    [package.dependencies] requests = ">=2.18.4" six = ">=1.11.0" typing-extensions = ">=4.0.1"

    [package.extras] aio = ["aiohttp (>=3.0)"]

    [[package]] name = "azure-identity" version = "1.11.0" description = "Microsoft Azure Identity Library for Python" category = "main" optional = false python-versions = ">=3.7"

    [package.dependencies] azure-core = ">=1.11.0,<2.0.0" cryptography = ">=2.5" msal = ">=1.12.0,<2.0.0" msal-extensions = ">=0.3.0,<2.0.0" six = ">=1.12.0"

    [[package]] name = "azure-storage-blob" version = "12.13.1" description = "Microsoft Azure Blob Storage Client Library for Python" category = "main" optional = false python-versions = ">=3.6"

    [package.dependencies] azure-core = ">=1.23.1,<2.0.0" cryptography = ">=2.1.4" msrest = ">=0.6.21"

    [[package]] name = "black" version = "22.12.0" description = "The uncompromising code formatter." category = "dev" optional = false python-versions = ">=3.7"

    [package.dependencies] click = ">=8.0.0" mypy-extensions = ">=0.4.3" pathspec = ">=0.9.0" platformdirs = ">=2" tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""} typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""}

    [package.extras] colorama = ["colorama (>=0.4.3)"] d = ["aiohttp (>=3.7.4)"] jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] uvloop = ["uvloop (>=0.15.2)"]

    [[package]] name = "certifi" version = "2022.12.7" description = "Python package for providing Mozilla's CA Bundle." category = "main" optional = false python-versions = ">=3.6"

    [[package]] name = "cffi" version = "1.15.1" description = "Foreign Function Interface for Python calling C code." category = "main" optional = false python-versions = "*"

    [package.dependencies] pycparser = "*"

    [[package]] name = "cfgv" version = "3.3.1" description = "Validate configuration and produce human readable error messages." category = "dev" optional = false python-versions = ">=3.6.1"

    [[package]] name = "charset-normalizer" version = "2.1.1" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." category = "main" optional = false python-versions = ">=3.6.0"

    [package.extras] unicode_backport = ["unicodedata2"]

    [[package]] name = "classify-imports" version = "4.2.0" description = "Utilities for refactoring imports in python-like syntax." category = "dev" optional = false python-versions = ">=3.7"

    [[package]] name = "click" version = "8.1.3" description = "Composable command line interface toolkit" category = "dev" optional = false python-versions = ">=3.7"

    [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""}

    [[package]] name = "cloudpickle" version = "2.0.0" description = "Extended pickling support for Python objects" category = "main" optional = false python-versions = ">=3.6"

    [[package]] name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." category = "dev" optional = false python-versions = "!=3.0.,!=3.1.,!=3.2.,!=3.3.,!=3.4.,!=3.5.,!=3.6.*,>=2.7"

    [[package]] name = "coverage" version = "6.5.0" description = "Code coverage measurement for Python" category = "dev" optional = false python-versions = ">=3.7"

    [package.dependencies] tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""}

    [package.extras] toml = ["tomli"]

    [[package]] name = "cryptography" version = "38.0.4" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." category = "main" optional = false python-versions = ">=3.6"

    [package.dependencies] cffi = ">=1.12"

    [package.extras] docs = ["sphinx (>=1.6.5,!=1.8.0,!=3.1.0,!=3.1.1)", "sphinx-rtd-theme"] docstest = ["pyenchant (>=1.6.11)", "sphinxcontrib-spelling (>=4.0.1)", "twine (>=1.12.0)"] pep8test = ["black", "flake8", "flake8-import-order", "pep8-naming"] sdist = ["setuptools-rust (>=0.11.4)"] ssh = ["bcrypt (>=3.1.5)"] test = ["hypothesis (>=1.11.4,!=3.79.2)", "iso8601", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-subtests", "pytest-xdist", "pytz"]

    [[package]] name = "dill" version = "0.3.6" description = "serialize all of python" category = "dev" optional = false python-versions = ">=3.7"

    [package.extras] graph = ["objgraph (>=1.7.2)"]

    [[package]] name = "distlib" version = "0.3.6" description = "Distribution utilities" category = "dev" optional = false python-versions = "*"

    [[package]] name = "exceptiongroup" version = "1.1.0" description = "Backport of PEP 654 (exception groups)" category = "dev" optional = false python-versions = ">=3.7"

    [package.extras] test = ["pytest (>=6)"]

    [[package]] name = "filelock" version = "3.9.0" description = "A platform independent file lock." category = "main" optional = false python-versions = ">=3.7"

    [package.extras] docs = ["furo (>=2022.12.7)", "sphinx (>=5.3)", "sphinx-autodoc-typehints (>=1.19.5)"] testing = ["covdefaults (>=2.2.2)", "coverage (>=7.0.1)", "pytest (>=7.2)", "pytest-cov (>=4)", "pytest-timeout (>=2.1)"]

    [[package]] name = "identify" version = "2.5.12" description = "File identification library for Python" category = "dev" optional = false python-versions = ">=3.7"

    [package.extras] license = ["ukkonen"]

    [[package]] name = "idna" version = "3.4" description = "Internationalized Domain Names in Applications (IDNA)" category = "main" optional = false python-versions = ">=3.5"

    [[package]] name = "iniconfig" version = "1.1.1" description = "iniconfig: brain-dead simple config-ini parsing" category = "dev" optional = false python-versions = "*"

    [[package]] name = "isodate" version = "0.6.1" description = "An ISO 8601 date/time/duration parser and formatter" category = "main" optional = false python-versions = "*"

    [package.dependencies] six = "*"

    [[package]] name = "isort" version = "5.11.4" description = "A Python utility / library to sort Python imports." category = "dev" optional = false python-versions = ">=3.7.0"

    [package.extras] colors = ["colorama (>=0.4.3,<0.5.0)"] pipfile-deprecated-finder = ["pipreqs", "requirementslib"] plugins = ["setuptools"] requirements-deprecated-finder = ["pip-api", "pipreqs"]

    [[package]] name = "kafka-python" version = "2.0.2" description = "Pure Python client for Apache Kafka" category = "main" optional = false python-versions = "*"

    [package.extras] crc32c = ["crc32c"]

    [[package]] name = "lazy-object-proxy" version = "1.8.0" description = "A fast and thorough lazy object proxy." category = "dev" optional = false python-versions = ">=3.7"

    [[package]] name = "lxml" version = "4.9.2" description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API." category = "dev" optional = false python-versions = ">=2.7, !=3.0., !=3.1., !=3.2., !=3.3., != 3.4.*"

    [package.extras] cssselect = ["cssselect (>=0.7)"] html5 = ["html5lib"] htmlsoup = ["BeautifulSoup4"] source = ["Cython (>=0.29.7)"]

    [[package]] name = "mccabe" version = "0.7.0" description = "McCabe checker, plugin for flake8" category = "dev" optional = false python-versions = ">=3.6"

    [[package]] name = "msal" version = "1.20.0" description = "The Microsoft Authentication Library (MSAL) for Python library enables your app to access the Microsoft Cloud by supporting authentication of users with Microsoft Azure Active Directory accounts (AAD) and Microsoft Accounts (MSA) using industry standard OAuth2 and OpenID Connect." category = "main" optional = false python-versions = "*"

    [package.dependencies] cryptography = ">=0.6,<41" PyJWT = {version = ">=1.0.0,<3", extras = ["crypto"]} requests = ">=2.0.0,<3"

    [package.extras] broker = ["pymsalruntime (>=0.11.2,<0.14)"]

    [[package]] name = "msal-extensions" version = "1.0.0" description = "Microsoft Authentication Library extensions (MSAL EX) provides a persistence API that can save your data on disk, encrypted on Windows, macOS and Linux. Concurrent data access will be coordinated by a file lock mechanism." category = "main" optional = false python-versions = "*"

    [package.dependencies] msal = ">=0.4.1,<2.0.0" portalocker = [ {version = ">=1.6,<3", markers = "python_version >= \"3.5\" and platform_system == \"Windows\""}, {version = ">=1.0,<3", markers = "python_version >= \"3.5\" and platform_system != \"Windows\""}, ]

    [[package]] name = "msrest" version = "0.7.1" description = "AutoRest swagger generator Python client runtime." category = "main" optional = false python-versions = ">=3.6"

    [package.dependencies] azure-core = ">=1.24.0" certifi = ">=2017.4.17" isodate = ">=0.6.0" requests = ">=2.16,<3.0" requests-oauthlib = ">=0.5.0"

    [package.extras] async = ["aiodns", "aiohttp (>=3.0)"]

    [[package]] name = "mypy-extensions" version = "0.4.3" description = "Experimental type system extensions for programs checked with the mypy typechecker." category = "dev" optional = false python-versions = "*"

    [[package]] name = "nodeenv" version = "1.7.0" description = "Node.js virtual environment builder" category = "dev" optional = false python-versions = ">=2.7,!=3.0.,!=3.1.,!=3.2.,!=3.3.,!=3.4.,!=3.5.,!=3.6.*"

    [package.dependencies] setuptools = "*"

    [[package]] name = "numpy" version = "1.24.1" description = "Fundamental package for array computing in Python" category = "main" optional = false python-versions = ">=3.8"

    [[package]] name = "oauthlib" version = "3.2.2" description = "A generic, spec-compliant, thorough implementation of the OAuth request-signing logic" category = "main" optional = false python-versions = ">=3.6"

    [package.extras] rsa = ["cryptography (>=3.0.0)"] signals = ["blinker (>=1.4.0)"] signedtoken = ["cryptography (>=3.0.0)", "pyjwt (>=2.0.0,<3)"]

    [[package]] name = "oscrypto" version = "1.3.0" description = "TLS (SSL) sockets, key generation, encryption, decryption, signing, verification and KDFs using the OS crypto libraries. Does not require a compiler, and relies on the OS for patching. Works on Windows, OS X and Linux/BSD." category = "main" optional = false python-versions = "*"

    [package.dependencies] asn1crypto = ">=1.5.1"

    [[package]] name = "packaging" version = "22.0" description = "Core utilities for Python packages" category = "dev" optional = false python-versions = ">=3.7"

    [[package]] name = "pandas" version = "1.5.0" description = "Powerful data structures for data analysis, time series, and statistics" category = "main" optional = false python-versions = ">=3.8"

    [package.dependencies] numpy = {version = ">=1.20.3", markers = "python_version < \"3.10\""} python-dateutil = ">=2.8.1" pytz = ">=2020.1"

    [package.extras] test = ["hypothesis (>=5.5.3)", "pytest (>=6.0)", "pytest-xdist (>=1.31)"]

    [[package]] name = "pathspec" version = "0.10.3" description = "Utility library for gitignore style pattern matching of file paths." category = "dev" optional = false python-versions = ">=3.7"

    [[package]] name = "platformdirs" version = "2.6.2" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." category = "dev" optional = false python-versions = ">=3.7"

    [package.extras] docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=5.3)", "sphinx-autodoc-typehints (>=1.19.5)"] test = ["appdirs (==1.4.4)", "covdefaults (>=2.2.2)", "pytest (>=7.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"]

    [[package]] name = "pluggy" version = "1.0.0" description = "plugin and hook calling mechanisms for python" category = "dev" optional = false python-versions = ">=3.6"

    [package.extras] dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"]

    [[package]] name = "portalocker" version = "2.6.0" description = "Wraps the portalocker recipe for easy usage" category = "main" optional = false python-versions = ">=3.5"

    [package.dependencies] pywin32 = {version = ">=226", markers = "platform_system == \"Windows\""}

    [package.extras] docs = ["sphinx (>=1.7.1)"] redis = ["redis"] tests = ["pytest (>=5.4.1)", "pytest-cov (>=2.8.1)", "pytest-mypy (>=0.8.0)", "pytest-timeout (>=2.1.0)", "redis", "sphinx (>=3.0.3)"]

    [[package]] name = "pre-commit" version = "2.21.0" description = "A framework for managing and maintaining multi-language pre-commit hooks." category = "dev" optional = false python-versions = ">=3.7"

    [package.dependencies] cfgv = ">=2.0.0" identify = ">=1.0.0" nodeenv = ">=0.11.1" pyyaml = ">=5.1" virtualenv = ">=20.10.0"

    [[package]] name = "pre-commit-hooks" version = "4.4.0" description = "Some out-of-the-box hooks for pre-commit." category = "dev" optional = false python-versions = ">=3.7"

    [package.dependencies] "ruamel.yaml" = ">=0.15" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""}

    [[package]] name = "pycparser" version = "2.21" description = "C parser in Python" category = "main" optional = false python-versions = ">=2.7, !=3.0., !=3.1., !=3.2., !=3.3."

    [[package]] name = "pycryptodomex" version = "3.16.0" description = "Cryptographic library for Python" category = "main" optional = false python-versions = ">=2.7, !=3.0., !=3.1., !=3.2., !=3.3., !=3.4.*"

    [[package]] name = "pydocstyle" version = "6.2.2" description = "Python docstring style checker" category = "dev" optional = false python-versions = ">=3.6"

    [package.dependencies] snowballstemmer = ">=2.2.0"

    [package.extras] toml = ["tomli (>=1.2.3)"]

    [[package]] name = "PyJWT" version = "2.6.0" description = "JSON Web Token implementation in Python" category = "main" optional = false python-versions = ">=3.7"

    [package.dependencies] cryptography = {version = ">=3.4.0", optional = true, markers = "extra == \"crypto\""}

    [package.extras] crypto = ["cryptography (>=3.4.0)"] dev = ["coverage[toml] (==5.0.4)", "cryptography (>=3.4.0)", "pre-commit", "pytest (>=6.0.0,<7.0.0)", "sphinx (>=4.5.0,<5.0.0)", "sphinx-rtd-theme", "zope.interface"] docs = ["sphinx (>=4.5.0,<5.0.0)", "sphinx-rtd-theme", "zope.interface"] tests = ["coverage[toml] (==5.0.4)", "pytest (>=6.0.0,<7.0.0)"]

    [[package]] name = "pylint" version = "2.15.9" description = "python code static checker" category = "dev" optional = false python-versions = ">=3.7.2"

    [package.dependencies] astroid = ">=2.12.13,<=2.14.0-dev0" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = {version = ">=0.2", markers = "python_version < \"3.11\""} isort = ">=4.2.5,<6" mccabe = ">=0.6,<0.8" platformdirs = ">=2.2.0" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} tomlkit = ">=0.10.1" typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""}

    [package.extras] spelling = ["pyenchant (>=3.2,<4.0)"] testutils = ["gitpython (>3)"]

    [[package]] name = "pyOpenSSL" version = "22.1.0" description = "Python wrapper module around the OpenSSL library" category = "main" optional = false python-versions = ">=3.6"

    [package.dependencies] cryptography = ">=38.0.0,<39"

    [package.extras] docs = ["sphinx (!=5.2.0,!=5.2.0.post0)", "sphinx-rtd-theme"] test = ["flaky", "pretend", "pytest (>=3.0.1)"]

    [[package]] name = "pytest" version = "7.2.0" description = "pytest: simple powerful testing with Python" category = "dev" optional = false python-versions = ">=3.7"

    [package.dependencies] attrs = ">=19.2.0" colorama = {version = "", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "" packaging = "*" pluggy = ">=0.12,<2.0" tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""}

    [package.extras] testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"]

    [[package]] name = "pytest-dotenv" version = "0.5.2" description = "A py.test plugin that parses environment files before running tests" category = "dev" optional = false python-versions = "*"

    [package.dependencies] pytest = ">=5.0.0" python-dotenv = ">=0.9.1"

    [[package]] name = "python-dateutil" version = "2.8.2" description = "Extensions to the standard Python datetime module" category = "main" optional = false python-versions = "!=3.0.,!=3.1.,!=3.2.*,>=2.7"

    [package.dependencies] six = ">=1.5"

    [[package]] name = "python-dotenv" version = "0.21.0" description = "Read key-value pairs from a .env file and set them as environment variables" category = "main" optional = false python-versions = ">=3.7"

    [package.extras] cli = ["click (>=5.0)"]

    [[package]] name = "pytz" version = "2022.7" description = "World timezone definitions, modern and historical" category = "main" optional = false python-versions = "*"

    [[package]] name = "pywin32" version = "305" description = "Python for Window Extensions" category = "main" optional = false python-versions = "*"

    [[package]] name = "PyYAML" version = "6.0" description = "YAML parser and emitter for Python" category = "dev" optional = false python-versions = ">=3.6"

    [[package]] name = "reorder-python-imports" version = "3.9.0" description = "Tool for reordering python imports" category = "dev" optional = false python-versions = ">=3.7"

    [package.dependencies] classify-imports = ">=4.1"

    [[package]] name = "requests" version = "2.28.1" description = "Python HTTP for Humans." category = "main" optional = false python-versions = ">=3.7, <4"

    [package.dependencies] certifi = ">=2017.4.17" charset-normalizer = ">=2,<3" idna = ">=2.5,<4" urllib3 = ">=1.21.1,<1.27"

    [package.extras] socks = ["PySocks (>=1.5.6,!=1.5.7)"] use_chardet_on_py3 = ["chardet (>=3.0.2,<6)"]

    [[package]] name = "requests-oauthlib" version = "1.3.1" description = "OAuthlib authentication support for Requests." category = "main" optional = false python-versions = ">=2.7, !=3.0., !=3.1., !=3.2., !=3.3."

    [package.dependencies] oauthlib = ">=3.0.0" requests = ">=2.0.0"

    [package.extras] rsa = ["oauthlib[signedtoken] (>=3.0.0)"]

    [[package]] name = "ruamel.yaml" version = "0.17.21" description = "ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order" category = "dev" optional = false python-versions = ">=3"

    [package.dependencies] "ruamel.yaml.clib" = {version = ">=0.2.6", markers = "platform_python_implementation == \"CPython\" and python_version < \"3.11\""}

    [package.extras] docs = ["ryd"] jinja2 = ["ruamel.yaml.jinja2 (>=0.2)"]

    [[package]] name = "ruamel.yaml.clib" version = "0.2.7" description = "C version of reader, parser and emitter for ruamel.yaml derived from libyaml" category = "dev" optional = false python-versions = ">=3.5"

    [[package]] name = "setuptools" version = "65.3.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" category = "main" optional = false python-versions = ">=3.7"

    [package.extras] docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8 (<5)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "mock", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"]

    [[package]] name = "six" version = "1.16.0" description = "Python 2 and 3 compatibility utilities" category = "main" optional = false python-versions = ">=2.7, !=3.0., !=3.1., !=3.2.*"

    [[package]] name = "snowballstemmer" version = "2.2.0" description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." category = "dev" optional = false python-versions = "*"

    [[package]] name = "snowflake-connector-python" version = "2.9.0" description = "Snowflake Connector for Python" category = "main" optional = false python-versions = ">=3.7"

    [package.dependencies] asn1crypto = ">0.24.0,<2.0.0" certifi = ">=2017.4.17" cffi = ">=1.9,<2.0.0" charset-normalizer = ">=2,<3" cryptography = ">=3.1.0,<41.0.0" filelock = ">=3.5,<4" idna = ">=2.5,<4" oscrypto = "<2.0.0" pycryptodomex = ">=3.2,<3.5.0 || >3.5.0,<4.0.0" pyjwt = "<3.0.0" pyOpenSSL = ">=16.2.0,<23.0.0" pytz = "*" requests = "<3.0.0" setuptools = ">34.0.0" typing-extensions = ">=4.3,<5" urllib3 = ">=1.21.1,<1.27"

    [package.extras] development = ["Cython", "coverage", "more-itertools", "numpy (<1.24.0)", "pendulum (!=2.1.1)", "pexpect", "pytest (<7.3.0)", "pytest-cov", "pytest-rerunfailures", "pytest-timeout", "pytest-xdist", "pytzdata"] pandas = ["pandas (>=1.0.0,<1.6.0)", "pyarrow (>=8.0.0,<8.1.0)"] secure-local-storage = ["keyring (!=16.1.0,<24.0.0)"]

    [[package]] name = "snowflake-snowpark-python" version = "1.0.0" description = "Snowflake Snowpark for Python" category = "main" optional = false python-versions = "==3.8.*"

    [package.dependencies] cloudpickle = ">=1.6.0,<=2.0.0" setuptools = ">=40.6.0" snowflake-connector-python = ">=2.7.12,<3.0.0" typing-extensions = ">=4.1.0,<5.0.0" wheel = "*"

    [package.extras] development = ["cachetools", "coverage", "pytest", "pytest-cov", "sphinx (==5.0.2)"] pandas = ["snowflake-connector-python[pandas] (>=2.7.12,<3.0.0)"] secure-local-storage = ["snowflake-connector-python[secure-local-storage] (>=2.7.12,<3.0.0)"]

    [[package]] name = "tomli" version = "2.0.1" description = "A lil' TOML parser" category = "dev" optional = false python-versions = ">=3.7"

    [[package]] name = "tomlkit" version = "0.11.6" description = "Style preserving TOML library" category = "dev" optional = false python-versions = ">=3.6"

    [[package]] name = "typing-extensions" version = "4.4.0" description = "Backported and Experimental Type Hints for Python 3.7+" category = "main" optional = false python-versions = ">=3.7"

    [[package]] name = "unittest-xml-reporting" version = "3.2.0" description = "unittest-based test runner with Ant/JUnit like XML reporting." category = "dev" optional = false python-versions = ">=3.7"

    [package.dependencies] lxml = "*"

    [[package]] name = "urllib3" version = "1.26.13" description = "HTTP library with thread-safe connection pooling, file post, and more." category = "main" optional = false python-versions = ">=2.7, !=3.0., !=3.1., !=3.2., !=3.3., !=3.4., !=3.5."

    [package.extras] brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"]

    [[package]] name = "virtualenv" version = "20.17.1" description = "Virtual Python Environment builder" category = "dev" optional = false python-versions = ">=3.6"

    [package.dependencies] distlib = ">=0.3.6,<1" filelock = ">=3.4.1,<4" platformdirs = ">=2.4,<3"

    [package.extras] docs = ["proselint (>=0.13)", "sphinx (>=5.3)", "sphinx-argparse (>=0.3.2)", "sphinx-rtd-theme (>=1)", "towncrier (>=22.8)"] testing = ["coverage (>=6.2)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=21.3)", "pytest (>=7.0.1)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.2)", "pytest-mock (>=3.6.1)", "pytest-randomly (>=3.10.3)", "pytest-timeout (>=2.1)"]

    [[package]] name = "wheel" version = "0.38.4" description = "A built-package format for Python" category = "main" optional = false python-versions = ">=3.7"

    [package.extras] test = ["pytest (>=3.0.0)"]

    [[package]] name = "wrapt" version = "1.14.1" description = "Module for decorators, wrappers and monkey patching." category = "dev" optional = false python-versions = "!=3.0.,!=3.1.,!=3.2.,!=3.3.,!=3.4.*,>=2.7"

  4. What did you do? I basically want to export a table in form of a json string to send it to a kafka broker.According to https://community.snowflake.com/s/article/Generating-a-JSON-Dataset-using-Relational-Data-in-Snowflake it's solved with the function object_construct

    schema = StructType([   StructField("name", StringType()),
                            StructField("nr_of_legs", IntegerType()),
                            ])
    
    data = [["dog",4]]
    df = snowflake_client.session.create_dataframe(data, schema)
    df.show()
    df = df.with_column("json",object_construct('name','"name","nr_of_legs"))
    df.show()
  5. What did you expect to see? The resulted df is:

    |"NAME" |"NR_OF_LEGS" |"JSON" |

    |dog |4 |{ | | | | "dog": 4 | | | |} |

    The expected df according to https://community.snowflake.com/s/article/Generating-a-JSON-Dataset-using-Relational-Data-in- Snowflake is:

    |"NAME" |"NR_OF_LEGS" |"JSON" |

    |dog |4 |{ | | | | "NAME": "dog", | | | | "NR_OF_LEGS": 4 | | | |} |

  6. Can you set logging to DEBUG and collect the logs? There is no logging needed

RalfKow commented 1 year ago

Sorry, I solved it by using object_construct(lit("name"),"name")