Skip to content
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

SNOW-1309051: Arrays not translating into proper sql #1914

Closed
DreamwareDevelopment opened this issue Apr 5, 2024 · 6 comments
Closed

SNOW-1309051: Arrays not translating into proper sql #1914

DreamwareDevelopment opened this issue Apr 5, 2024 · 6 comments
Assignees
Labels
status-triage_done Initial triage done, will be further handled by the driver team

Comments

@DreamwareDevelopment
Copy link

Python version

Python 3.11.4 (main, Jul 13 2023, 22:36:37) [Clang 14.0.3 (clang-1403.0.22.14.1)]

Operating system and processor architecture

macOS-13.6.2-arm64-arm-64bit

Installed packages

aiohttp==3.9.3
aiosignal==1.3.1
alembic==1.13.1
aniso8601==9.0.1
anthropic==0.23.1
anyio==4.3.0
asn1crypto==1.5.1
astroid==3.1.0
attrs==23.2.0
backoff==2.2.1
beautifulsoup4==4.12.3
black==24.3.0
cachetools==5.3.3
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
coloredlogs==14.0
coverage==7.4.4
croniter==2.0.3
cryptography==41.0.7
dagster==1.6.3
dagster-gcp==0.22.3
dagster-graphql==1.6.3
dagster-k8s==0.22.3
dagster-pandas==0.22.3
dagster-pipes==1.6.3
dagster-postgres==0.22.3
dagster-snowflake==0.22.3
dagster-snowflake-pandas==0.22.3
dagster-webserver==1.6.3
db-dtypes==1.2.0
dill==0.3.8
distro==1.9.0
docstring_parser==0.16
filelock==3.13.3
flake8==7.0.0
frozenlist==1.4.1
fsspec==2024.3.1
google-api-core==2.18.0
google-api-python-client==2.125.0
google-auth==2.29.0
google-auth-httplib2==0.2.0
google-cloud-bigquery==3.20.1
google-cloud-core==2.4.1
google-cloud-storage==2.16.0
google-crc32c==1.5.0
google-resumable-media==2.7.0
googleapis-common-protos==1.63.0
gql==3.5.0
graphene==3.3
graphql-core==3.2.3
graphql-relay==3.2.0
greenlet==3.0.3
grpcio==1.62.1
grpcio-health-checking==1.62.1
grpcio-status==1.62.1
h11==0.14.0
h3==3.7.7
httpcore==1.0.5
httplib2==0.22.0
httptools==0.6.1
httpx==0.27.0
huggingface-hub==0.22.2
humanfriendly==10.0
idna==3.6
iniconfig==2.0.0
isort==5.13.2
Jinja2==3.1.3
kubernetes==29.0.0
Mako==1.3.2
markdown-it-py==3.0.0
MarkupSafe==2.1.5
mccabe==0.7.0
mdurl==0.1.2
multidict==6.0.5
mypy-extensions==1.0.0
nodeenv==1.8.0
numpy==1.26.4
oauth2client==4.1.3
oauthlib==3.2.2
openai==1.16.2
packaging==24.0
pandas==2.0.3
pathspec==0.12.1
pendulum==3.0.0
platformdirs==3.11.0
playwright==1.41.2
playwright-stealth==1.0.6
pluggy==1.4.0
-e git+https://github.com/DreamwareDevelopment/Corso-Data.git@6f425ead63416801a9182383c6074f5fa2d4df3f#egg=pmap_data
proto-plus==1.23.0
protobuf==4.25.3
psycopg2-binary==2.9.9
pyarrow==10.0.1
pyasn1==0.6.0
pyasn1_modules==0.4.0
pycodestyle==2.11.1
pycparser==2.22
pydantic==1.10.15
pyee==11.0.1
pyflakes==3.2.0
Pygments==2.17.2
PyJWT==2.8.0
pylint==3.1.0
pyOpenSSL==23.3.0
pyparsing==3.1.2
pyright==1.1.357
pytest==8.1.1
pytest-asyncio==0.23.6
pytest-cov==5.0.0
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
pytz==2024.1
PyYAML==6.0.1
requests==2.31.0
requests-oauthlib==2.0.0
requests-toolbelt==1.0.0
rich==13.7.1
rsa==4.9
six==1.16.0
sniffio==1.3.1
snowflake-connector-python==3.4.1
snowflake-sqlalchemy==1.5.1
sortedcontainers==2.4.0
soupsieve==2.5
SQLAlchemy==1.4.52
sqlalchemy2-stubs==0.0.2a38
sqlmodel==0.0.11
starlette==0.37.2
structlog==24.1.0
tabulate==0.9.0
time-machine==2.14.1
timezonefinder==6.5.0
tokenizers==0.15.2
tomli==2.0.1
tomlkit==0.12.4
toposort==1.10
tqdm==4.66.2
typing_extensions==4.11.0
tzdata==2024.1
universal_pathlib==0.2.2
uritemplate==4.1.1
urllib3==1.26.18
uvicorn==0.29.0
uvloop==0.19.0
watchdog==4.0.0
watchfiles==0.21.0
websocket-client==1.7.0
websockets==12.0
yarl==1.9.4

What did you do?

I'm using sqlmodel (which uses sqlalchemy under the hood) to define an array property like so:

from snowflake.sqlalchemy import ARRAY
from sqlmodel import SQLModel
...
def SomeModel(SQLModel, Table=True)
    tags: list[str] = Field(default=[], sa_column=Column(ARRAY))

However, the connector is putting in empty strings instead of an empty array.

I get the following error from sqlalchemy:
sqlalchemy.exc.ProgrammingError: (snowflake.connector.errors.ProgrammingError) 001003 (42000): SQL compilation error: syntax error line 1 at position 1,244 unexpected ','.

When I change the line to return an empty array if there are no values, I get the following:
sqlalchemy.exc.ProgrammingError: (snowflake.connector.errors.ProgrammingError) 002014 (22000): SQL compilation error: Invalid expression [ARRAY_CONSTRUCT()] in VALUES clause

However, this is strange because the sql sent to snowflake doesn't include the ARRAY_CONSTRUCT() function. So I assume that Snowflake is adding it on the backend.

I've tried patching it but I keep coming up with either the unexpected comma error, the ARRAY_CONSTRUCT error, or another one when I'm ensuring the arrays aren't empty:

sqlalchemy.exc.ProgrammingError: (snowflake.connector.errors.ProgrammingError) 002023 (22000): 01b379c4-0001-eb7a-0000-0002a8dae7c5: SQL compilation error: Expression type does not match column data type, expecting ARRAY but got VARCHAR(4) for column TAGS



### What did you expect to see?

The array should be able to be saved to snowflake without SQL compilation errors.

### Can you set logging to DEBUG and collect the logs?

```bash
2024-04-05 16:32:31,549 - MainThread connection.py:350 - __init__() - INFO - Snowflake Connector for Python Version: 3.4.1, Python Version: 3.11.4, Platform: macOS-13.6.2-arm64-arm-64bit
2024-04-05 16:32:31,549 - MainThread connection.py:649 - connect() - DEBUG - connect
2024-04-05 16:32:31,549 - MainThread connection.py:1013 - __config() - DEBUG - __config
2024-04-05 16:32:31,550 - MainThread connection.py:1163 - __config() - INFO - This connection is in OCSP Fail Open Mode. TLS Certificates would be checked for validity and revocation status. Any other Certificate Revocation related exceptions or OCSP Responder failures would be disregarded in favor of connectivity.
2024-04-05 16:32:31,550 - MainThread converter.py:146 - __init__() - DEBUG - use_numpy: False
2024-04-05 16:32:31,550 - MainThread connection.py:855 - __open_connection() - DEBUG - REST API object was created: gtojrgr-au98510.snowflakecomputing.com:443
2024-04-05 16:32:31,550 - MainThread _auth.py:174 - authenticate() - DEBUG - authenticate
2024-04-05 16:32:31,550 - MainThread _auth.py:208 - authenticate() - DEBUG - assertion content: *********
2024-04-05 16:32:31,550 - MainThread _auth.py:211 - authenticate() - DEBUG - account=gtojrgr-au98510, user=zanburger, database=pmap, schema=master, warehouse=compute_wh, role=None, request_id=7dd84b02-82e7-491f-bdea-64e49a0ac592
2024-04-05 16:32:31,550 - MainThread _auth.py:244 - authenticate() - DEBUG - body['data']: {'CLIENT_APP_ID': 'SnowflakeSQLAlchemy', 'CLIENT_APP_VERSION': '1.5.1', 'SVN_REVISION': None, 'ACCOUNT_NAME': 'gtojrgr-au98510', 'LOGIN_NAME': 'zanburger', 'CLIENT_ENVIRONMENT': {'APPLICATION': 'SnowflakeSQLAlchemy', 'OS': 'Darwin', 'OS_VERSION': 'macOS-13.6.2-arm64-arm-64bit', 'PYTHON_VERSION': '3.11.4', 'PYTHON_RUNTIME': 'CPython', 'PYTHON_COMPILER': 'Clang 14.0.3 (clang-1403.0.22.14.1)', 'OCSP_MODE': 'FAIL_OPEN', 'TRACING': 10, 'LOGIN_TIMEOUT': None, 'NETWORK_TIMEOUT': None, 'SOCKET_TIMEOUT': None}, 'SESSION_PARAMETERS': {'AUTOCOMMIT': False, 'TIMEZONE': 'UTC', 'CLIENT_PREFETCH_THREADS': 4}}
2024-04-05 16:32:31,550 - MainThread retry.py:351 - from_int() - DEBUG - Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
2024-04-05 16:32:31,550 - MainThread retry.py:351 - from_int() - DEBUG - Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
2024-04-05 16:32:31,550 - MainThread network.py:1217 - _use_requests_session() - DEBUG - Session status for SessionPool 'gtojrgr-au98510.snowflakecomputing.com', SessionPool 1/1 active sessions
2024-04-05 16:32:31,550 - MainThread network.py:868 - _request_exec_wrapper() - DEBUG - remaining request timeout: N/A ms, retry cnt: 1
2024-04-05 16:32:31,550 - MainThread network.py:850 - add_request_guid() - DEBUG - Request guid: 6627583b-fe6b-4e48-a787-a41e059e459d
2024-04-05 16:32:31,550 - MainThread network.py:1058 - _request_exec() - DEBUG - socket timeout: 60
2024-04-05 16:32:31,666 - MainThread connectionpool.py:1019 - _new_conn() - DEBUG - Starting new HTTPS connection (1): gtojrgr-au98510.snowflakecomputing.com:443
2024-04-05 16:32:31,862 - MainThread ssl_wrap_socket.py:79 - ssl_wrap_socket_with_ocsp() - DEBUG - OCSP Mode: FAIL_OPEN, OCSP response cache file name: None
2024-04-05 16:32:31,869 - MainThread ocsp_snowflake.py:492 - reset_cache_dir() - DEBUG - cache directory: /Users/zander/Library/Caches/Snowflake
2024-04-05 16:32:31,870 - MainThread ocsp_snowflake.py:530 - reset_ocsp_response_cache_uri() - DEBUG - ocsp_response_cache_uri: file:///Users/zander/Library/Caches/Snowflake/ocsp_response_cache.json
2024-04-05 16:32:31,870 - MainThread ocsp_snowflake.py:533 - reset_ocsp_response_cache_uri() - DEBUG - OCSP_VALIDATION_CACHE size: 222
2024-04-05 16:32:31,870 - MainThread ocsp_snowflake.py:332 - reset_ocsp_dynamic_cache_server_url() - DEBUG - OCSP response cache server is enabled: http://ocsp.snowflakecomputing.com/ocsp_response_cache.json
2024-04-05 16:32:31,870 - MainThread ocsp_snowflake.py:345 - reset_ocsp_dynamic_cache_server_url() - DEBUG - OCSP dynamic cache server RETRY URL: None
2024-04-05 16:32:31,870 - MainThread ocsp_snowflake.py:966 - validate() - DEBUG - validating certificate: gtojrgr-au98510.snowflakecomputing.com
2024-04-05 16:32:31,870 - MainThread ocsp_asn1crypto.py:385 - extract_certificate_chain() - DEBUG - # of certificates: 3
2024-04-05 16:32:31,870 - MainThread ocsp_asn1crypto.py:390 - extract_certificate_chain() - DEBUG - subject: OrderedDict([('country_name', 'US'), ('state_or_province_name', 'California'), ('locality_name', 'San Mateo'), ('organization_name', 'Snowflake Inc.'), ('common_name', '*.us-central1.gcp.snowflakecomputing.com')]), issuer: OrderedDict([('country_name', 'US'), ('organization_name', 'DigiCert Inc'), ('common_name', 'DigiCert Global G2 TLS RSA SHA256 2020 CA1')])
2024-04-05 16:32:31,870 - MainThread ocsp_asn1crypto.py:390 - extract_certificate_chain() - DEBUG - subject: OrderedDict([('country_name', 'US'), ('organization_name', 'DigiCert Inc'), ('common_name', 'DigiCert Global G2 TLS RSA SHA256 2020 CA1')]), issuer: OrderedDict([('country_name', 'US'), ('organization_name', 'DigiCert Inc'), ('organizational_unit_name', 'www.digicert.com'), ('common_name', 'DigiCert Global Root G2')])
2024-04-05 16:32:31,871 - MainThread ocsp_asn1crypto.py:390 - extract_certificate_chain() - DEBUG - subject: OrderedDict([('country_name', 'US'), ('organization_name', 'DigiCert Inc'), ('organizational_unit_name', 'www.digicert.com'), ('common_name', 'DigiCert Global Root G2')]), issuer: OrderedDict([('country_name', 'US'), ('organization_name', 'DigiCert Inc'), ('organizational_unit_name', 'www.digicert.com'), ('common_name', 'DigiCert Global Root G2')])
2024-04-05 16:32:31,872 - MainThread ocsp_snowflake.py:730 - find_cache() - DEBUG - hit cache for subject: OrderedDict([('country_name', 'US'), ('state_or_province_name', 'California'), ('locality_name', 'San Mateo'), ('organization_name', 'Snowflake Inc.'), ('common_name', '*.us-central1.gcp.snowflakecomputing.com')])
2024-04-05 16:32:31,872 - MainThread ocsp_snowflake.py:730 - find_cache() - DEBUG - hit cache for subject: OrderedDict([('country_name', 'US'), ('organization_name', 'DigiCert Inc'), ('common_name', 'DigiCert Global G2 TLS RSA SHA256 2020 CA1')])
2024-04-05 16:32:31,873 - MainThread ocsp_snowflake.py:1023 - _validate() - DEBUG - ok
2024-04-05 16:32:32,209 - MainThread connectionpool.py:474 - _make_request() - DEBUG - https://gtojrgr-au98510.snowflakecomputing.com:443 "POST /session/v1/login-request?request_id=7dd84b02-82e7-491f-bdea-64e49a0ac592&databaseName=pmap&schemaName=master&warehouse=compute_wh&request_guid=6627583b-fe6b-4e48-a787-a41e059e459d HTTP/1.1" 200 None
2024-04-05 16:32:32,210 - MainThread network.py:1085 - _request_exec() - DEBUG - SUCCESS
2024-04-05 16:32:32,210 - MainThread network.py:1222 - _use_requests_session() - DEBUG - Session status for SessionPool 'gtojrgr-au98510.snowflakecomputing.com', SessionPool 0/1 active sessions
2024-04-05 16:32:32,210 - MainThread network.py:740 - _post_request() - DEBUG - ret[code] = None, after post request
2024-04-05 16:32:32,210 - MainThread _auth.py:371 - authenticate() - DEBUG - completed authentication
2024-04-05 16:32:32,211 - MainThread _auth.py:418 - authenticate() - DEBUG - token = ******
2024-04-05 16:32:32,211 - MainThread _auth.py:424 - authenticate() - DEBUG - master_token = ******
2024-04-05 16:32:32,211 - MainThread _auth.py:430 - authenticate() - DEBUG - id_token = NULL
2024-04-05 16:32:32,211 - MainThread _auth.py:436 - authenticate() - DEBUG - mfa_token = NULL
2024-04-05 16:32:32,217 - MainThread connection.py:774 - cursor() - DEBUG - cursor
2024-04-05 16:32:32,218 - MainThread cursor.py:766 - execute() - DEBUG - executing SQL/command
2024-04-05 16:32:32,218 - MainThread connection.py:1488 - _process_params_dict() - DEBUG - parameters: {}
2024-04-05 16:32:32,218 - MainThread cursor.py:622 - _preprocess_pyformat_query() - DEBUG - binding: [select current_database(), current_schema();] with input=[{}], processed=[{}]
2024-04-05 16:32:32,218 - MainThread cursor.py:834 - execute() - INFO - query: [select current_database(), current_schema();]
2024-04-05 16:32:32,218 - MainThread connection.py:1534 - _next_sequence_counter() - DEBUG - sequence counter: 1
2024-04-05 16:32:32,219 - MainThread cursor.py:496 - _execute_helper() - DEBUG - Request id: 2ab71a28-317f-491c-b816-844074a7798b
2024-04-05 16:32:32,219 - MainThread cursor.py:498 - _execute_helper() - DEBUG - running query [select current_database(), current_schema();]
2024-04-05 16:32:32,219 - MainThread cursor.py:505 - _execute_helper() - DEBUG - is_file_transfer: True
2024-04-05 16:32:32,219 - MainThread connection.py:1197 - cmd_query() - DEBUG - _cmd_query
2024-04-05 16:32:32,219 - MainThread _query_context_cache.py:155 - serialize_to_dict() - DEBUG - serialize_to_dict() called
2024-04-05 16:32:32,219 - MainThread connection.py:1224 - cmd_query() - DEBUG - sql=[select current_database(), current_schema();], sequence_id=[1], is_file_transfer=[False]
2024-04-05 16:32:32,220 - MainThread network.py:1217 - _use_requests_session() - DEBUG - Session status for SessionPool 'gtojrgr-au98510.snowflakecomputing.com', SessionPool 1/1 active sessions
2024-04-05 16:32:32,220 - MainThread network.py:868 - _request_exec_wrapper() - DEBUG - remaining request timeout: N/A ms, retry cnt: 1
2024-04-05 16:32:32,220 - MainThread network.py:850 - add_request_guid() - DEBUG - Request guid: ab51ccb9-90ca-43f1-9dac-7382e20014c1
2024-04-05 16:32:32,220 - MainThread network.py:1058 - _request_exec() - DEBUG - socket timeout: 60
2024-04-05 16:32:32,373 - MainThread connectionpool.py:474 - _make_request() - DEBUG - https://gtojrgr-au98510.snowflakecomputing.com:443 "POST /queries/v1/query-request?requestId=2ab71a28-317f-491c-b816-844074a7798b&request_guid=ab51ccb9-90ca-43f1-9dac-7382e20014c1 HTTP/1.1" 200 None
2024-04-05 16:32:32,375 - MainThread network.py:1085 - _request_exec() - DEBUG - SUCCESS
2024-04-05 16:32:32,375 - MainThread network.py:1222 - _use_requests_session() - DEBUG - Session status for SessionPool 'gtojrgr-au98510.snowflakecomputing.com', SessionPool 0/1 active sessions
2024-04-05 16:32:32,375 - MainThread network.py:740 - _post_request() - DEBUG - ret[code] = None, after post request
2024-04-05 16:32:32,375 - MainThread network.py:764 - _post_request() - DEBUG - Query id: 01b379c4-0001-eb58-0002-a8da000127ce
2024-04-05 16:32:32,375 - MainThread _query_context_cache.py:189 - deserialize_json_dict() - DEBUG - deserialize_json_dict() called: data from server: {'entries': [{'id': 0, 'timestamp': 143347973923739, 'priority': 0}]}
2024-04-05 16:32:32,375 - MainThread _query_context_cache.py:230 - deserialize_json_dict() - DEBUG - deserialize {'id': 0, 'timestamp': 143347973923739, 'priority': 0}
2024-04-05 16:32:32,376 - MainThread _query_context_cache.py:101 - _sync_priority_map() - DEBUG - sync_priority_map called priority_map size = 0, new_priority_map size = 1
2024-04-05 16:32:32,376 - MainThread _query_context_cache.py:127 - trim_cache() - DEBUG - trim_cache() called. treeSet size is 1 and cache capacity is 5
2024-04-05 16:32:32,376 - MainThread _query_context_cache.py:136 - trim_cache() - DEBUG - trim_cache() returns. treeSet size is 1 and cache capacity is 5
2024-04-05 16:32:32,376 - MainThread _query_context_cache.py:269 - deserialize_json_dict() - DEBUG - deserialize_json_dict() returns
2024-04-05 16:32:32,376 - MainThread _query_context_cache.py:274 - log_cache_entries() - DEBUG - Cache Entry: (0, 143347973923739, 0)
2024-04-05 16:32:32,377 - MainThread cursor.py:841 - execute() - DEBUG - sfqid: 01b379c4-0001-eb58-0002-a8da000127ce
2024-04-05 16:32:32,377 - MainThread cursor.py:847 - execute() - INFO - query execution done
2024-04-05 16:32:32,377 - MainThread cursor.py:861 - execute() - DEBUG - SUCCESS
2024-04-05 16:32:32,377 - MainThread cursor.py:880 - execute() - DEBUG - PUT OR GET: False
2024-04-05 16:32:32,377 - MainThread cursor.py:975 - _init_result_and_meta() - DEBUG - Query result format: arrow
2024-04-05 16:32:32,377 - MainThread cursor.py:989 - _init_result_and_meta() - INFO - Number of results in first chunk: 1
2024-04-05 16:32:32,385 - MainThread result_batch.py:93 - _create_nanoarrow_iterator() - DEBUG - Using nanoarrow as the arrow data converter
2024-04-05 16:32:32,385 - MainThread CArrowIterator.cpp:53 - CArrowIterator() - DEBUG - Arrow BatchSize: 1
2024-04-05 16:32:32,385 - MainThread CArrowChunkIterator.cpp:38 - CArrowChunkIterator() - DEBUG - Arrow chunk info: batchCount 1, columnCount 2, use_numpy: 0
2024-04-05 16:32:32,385 - MainThread nanoarrow_arrow_iterator.cpython-311-darwin.so:0 - __cinit__() - DEBUG - Batches read: 0
2024-04-05 16:32:32,386 - MainThread result_set.py:59 - result_set_iterator() - DEBUG - beginning to schedule result batch downloads
2024-04-05 16:32:32,386 - MainThread CArrowChunkIterator.cpp:65 - next() - DEBUG - Current batch index: 0, rows in current batch: 1
2024-04-05 16:32:32,386 - MainThread connection.py:774 - cursor() - DEBUG - cursor
2024-04-05 16:32:32,386 - MainThread cursor.py:766 - execute() - DEBUG - executing SQL/command
2024-04-05 16:32:32,386 - MainThread cursor.py:622 - _preprocess_pyformat_query() - DEBUG - binding: [ROLLBACK] with input=[None], processed=[{}]
2024-04-05 16:32:32,386 - MainThread cursor.py:834 - execute() - INFO - query: [ROLLBACK]
2024-04-05 16:32:32,386 - MainThread connection.py:1534 - _next_sequence_counter() - DEBUG - sequence counter: 2
2024-04-05 16:32:32,386 - MainThread cursor.py:496 - _execute_helper() - DEBUG - Request id: 86e17fc0-84e9-4b52-811c-d49a4aea7462
2024-04-05 16:32:32,386 - MainThread cursor.py:498 - _execute_helper() - DEBUG - running query [ROLLBACK]
2024-04-05 16:32:32,386 - MainThread cursor.py:505 - _execute_helper() - DEBUG - is_file_transfer: True
2024-04-05 16:32:32,386 - MainThread connection.py:1197 - cmd_query() - DEBUG - _cmd_query
2024-04-05 16:32:32,387 - MainThread _query_context_cache.py:155 - serialize_to_dict() - DEBUG - serialize_to_dict() called
2024-04-05 16:32:32,387 - MainThread _query_context_cache.py:274 - log_cache_entries() - DEBUG - Cache Entry: (0, 143347973923739, 0)
2024-04-05 16:32:32,387 - MainThread _query_context_cache.py:178 - serialize_to_dict() - DEBUG - serialize_to_dict(): data to send to server {'entries': [{'id': 0, 'timestamp': 143347973923739, 'priority': 0, 'context': {}}]}
2024-04-05 16:32:32,387 - MainThread connection.py:1224 - cmd_query() - DEBUG - sql=[ROLLBACK], sequence_id=[2], is_file_transfer=[False]
2024-04-05 16:32:32,387 - MainThread network.py:1217 - _use_requests_session() - DEBUG - Session status for SessionPool 'gtojrgr-au98510.snowflakecomputing.com', SessionPool 1/1 active sessions
2024-04-05 16:32:32,387 - MainThread network.py:868 - _request_exec_wrapper() - DEBUG - remaining request timeout: N/A ms, retry cnt: 1
2024-04-05 16:32:32,387 - MainThread network.py:850 - add_request_guid() - DEBUG - Request guid: 5f46a111-158a-4571-9dc7-cb9160900102
2024-04-05 16:32:32,387 - MainThread network.py:1058 - _request_exec() - DEBUG - socket timeout: 60
2024-04-05 16:32:32,522 - MainThread connectionpool.py:474 - _make_request() - DEBUG - https://gtojrgr-au98510.snowflakecomputing.com:443 "POST /queries/v1/query-request?requestId=86e17fc0-84e9-4b52-811c-d49a4aea7462&request_guid=5f46a111-158a-4571-9dc7-cb9160900102 HTTP/1.1" 200 None
2024-04-05 16:32:32,523 - MainThread network.py:1085 - _request_exec() - DEBUG - SUCCESS
2024-04-05 16:32:32,523 - MainThread network.py:1222 - _use_requests_session() - DEBUG - Session status for SessionPool 'gtojrgr-au98510.snowflakecomputing.com', SessionPool 0/1 active sessions
2024-04-05 16:32:32,523 - MainThread network.py:740 - _post_request() - DEBUG - ret[code] = None, after post request
2024-04-05 16:32:32,523 - MainThread network.py:764 - _post_request() - DEBUG - Query id: 01b379c4-0001-eb76-0002-a8da0001a046
2024-04-05 16:32:32,523 - MainThread _query_context_cache.py:189 - deserialize_json_dict() - DEBUG - deserialize_json_dict() called: data from server: {'entries': [{'id': 0, 'timestamp': 143347974071539, 'priority': 0}]}
2024-04-05 16:32:32,523 - MainThread _query_context_cache.py:274 - log_cache_entries() - DEBUG - Cache Entry: (0, 143347973923739, 0)
2024-04-05 16:32:32,523 - MainThread _query_context_cache.py:230 - deserialize_json_dict() - DEBUG - deserialize {'id': 0, 'timestamp': 143347974071539, 'priority': 0}
2024-04-05 16:32:32,523 - MainThread _query_context_cache.py:101 - _sync_priority_map() - DEBUG - sync_priority_map called priority_map size = 0, new_priority_map size = 1
2024-04-05 16:32:32,523 - MainThread _query_context_cache.py:127 - trim_cache() - DEBUG - trim_cache() called. treeSet size is 1 and cache capacity is 5
2024-04-05 16:32:32,523 - MainThread _query_context_cache.py:136 - trim_cache() - DEBUG - trim_cache() returns. treeSet size is 1 and cache capacity is 5
2024-04-05 16:32:32,524 - MainThread _query_context_cache.py:269 - deserialize_json_dict() - DEBUG - deserialize_json_dict() returns
2024-04-05 16:32:32,524 - MainThread _query_context_cache.py:274 - log_cache_entries() - DEBUG - Cache Entry: (0, 143347974071539, 0)
2024-04-05 16:32:32,524 - MainThread cursor.py:841 - execute() - DEBUG - sfqid: 01b379c4-0001-eb76-0002-a8da0001a046
2024-04-05 16:32:32,524 - MainThread cursor.py:847 - execute() - INFO - query execution done
2024-04-05 16:32:32,524 - MainThread cursor.py:861 - execute() - DEBUG - SUCCESS
2024-04-05 16:32:32,524 - MainThread cursor.py:880 - execute() - DEBUG - PUT OR GET: False
2024-04-05 16:32:32,524 - MainThread cursor.py:975 - _init_result_and_meta() - DEBUG - Query result format: json
2024-04-05 16:32:32,524 - MainThread result_batch.py:512 - _parse() - DEBUG - parsing for result batch id: 1
2024-04-05 16:32:32,524 - MainThread cursor.py:989 - _init_result_and_meta() - INFO - Number of results in first chunk: 1
2024-04-05 16:32:32,526 - MainThread connection.py:774 - cursor() - DEBUG - cursor
2024-04-05 16:32:32,526 - MainThread cursor.py:766 - execute() - DEBUG - executing SQL/command
2024-04-05 16:32:32,526 - MainThread connection.py:1488 - _process_params_dict() - DEBUG - parameters: {}
2024-04-05 16:32:32,526 - MainThread cursor.py:622 - _preprocess_pyformat_query() - DEBUG - binding: [DELETE FROM master.permits WHERE DATE BETWEEN '2024-03-07 00:00:00' AND '2024-03...] with input=[{}], processed=[{}]
2024-04-05 16:32:32,526 - MainThread cursor.py:834 - execute() - INFO - query: [DELETE FROM master.permits WHERE DATE BETWEEN '2024-03-07 00:00:00' AND '2024-03...]
2024-04-05 16:32:32,527 - MainThread connection.py:1534 - _next_sequence_counter() - DEBUG - sequence counter: 3
2024-04-05 16:32:32,527 - MainThread cursor.py:496 - _execute_helper() - DEBUG - Request id: ffa0f6f4-9e1f-4a6c-9079-588180dd4747
2024-04-05 16:32:32,527 - MainThread cursor.py:498 - _execute_helper() - DEBUG - running query [DELETE FROM master.permits WHERE DATE BETWEEN '2024-03-07 00:00:00' AND '2024-03...]
2024-04-05 16:32:32,527 - MainThread cursor.py:505 - _execute_helper() - DEBUG - is_file_transfer: True
2024-04-05 16:32:32,527 - MainThread connection.py:1197 - cmd_query() - DEBUG - _cmd_query
2024-04-05 16:32:32,527 - MainThread _query_context_cache.py:155 - serialize_to_dict() - DEBUG - serialize_to_dict() called
2024-04-05 16:32:32,527 - MainThread _query_context_cache.py:274 - log_cache_entries() - DEBUG - Cache Entry: (0, 143347974071539, 0)
2024-04-05 16:32:32,527 - MainThread _query_context_cache.py:178 - serialize_to_dict() - DEBUG - serialize_to_dict(): data to send to server {'entries': [{'id': 0, 'timestamp': 143347974071539, 'priority': 0, 'context': {}}]}
2024-04-05 16:32:32,527 - MainThread connection.py:1224 - cmd_query() - DEBUG - sql=[DELETE FROM master.permits WHERE DATE BETWEEN '2024-03-07 00:00:00' AND '2024-03...], sequence_id=[3], is_file_transfer=[False]
2024-04-05 16:32:32,527 - MainThread network.py:1217 - _use_requests_session() - DEBUG - Session status for SessionPool 'gtojrgr-au98510.snowflakecomputing.com', SessionPool 1/1 active sessions
2024-04-05 16:32:32,528 - MainThread network.py:868 - _request_exec_wrapper() - DEBUG - remaining request timeout: N/A ms, retry cnt: 1
2024-04-05 16:32:32,528 - MainThread network.py:850 - add_request_guid() - DEBUG - Request guid: 09aa9488-ded5-4cb3-89a4-429455e02b02
2024-04-05 16:32:32,528 - MainThread network.py:1058 - _request_exec() - DEBUG - socket timeout: 60
2024-04-05 16:32:33,028 - MainThread connectionpool.py:474 - _make_request() - DEBUG - https://gtojrgr-au98510.snowflakecomputing.com:443 "POST /queries/v1/query-request?requestId=ffa0f6f4-9e1f-4a6c-9079-588180dd4747&request_guid=09aa9488-ded5-4cb3-89a4-429455e02b02 HTTP/1.1" 200 None
2024-04-05 16:32:33,029 - MainThread network.py:1085 - _request_exec() - DEBUG - SUCCESS
2024-04-05 16:32:33,030 - MainThread network.py:1222 - _use_requests_session() - DEBUG - Session status for SessionPool 'gtojrgr-au98510.snowflakecomputing.com', SessionPool 0/1 active sessions
2024-04-05 16:32:33,030 - MainThread network.py:740 - _post_request() - DEBUG - ret[code] = None, after post request
2024-04-05 16:32:33,030 - MainThread network.py:764 - _post_request() - DEBUG - Query id: 01b379c4-0001-eb6e-0002-a8da0001904e
2024-04-05 16:32:33,031 - MainThread _query_context_cache.py:189 - deserialize_json_dict() - DEBUG - deserialize_json_dict() called: data from server: {'entries': [{'id': 0, 'timestamp': 143347974522766, 'priority': 0}]}
2024-04-05 16:32:33,031 - MainThread _query_context_cache.py:274 - log_cache_entries() - DEBUG - Cache Entry: (0, 143347974071539, 0)
2024-04-05 16:32:33,031 - MainThread _query_context_cache.py:230 - deserialize_json_dict() - DEBUG - deserialize {'id': 0, 'timestamp': 143347974522766, 'priority': 0}
2024-04-05 16:32:33,031 - MainThread _query_context_cache.py:101 - _sync_priority_map() - DEBUG - sync_priority_map called priority_map size = 0, new_priority_map size = 1
2024-04-05 16:32:33,031 - MainThread _query_context_cache.py:127 - trim_cache() - DEBUG - trim_cache() called. treeSet size is 1 and cache capacity is 5
2024-04-05 16:32:33,031 - MainThread _query_context_cache.py:136 - trim_cache() - DEBUG - trim_cache() returns. treeSet size is 1 and cache capacity is 5
2024-04-05 16:32:33,031 - MainThread _query_context_cache.py:269 - deserialize_json_dict() - DEBUG - deserialize_json_dict() returns
2024-04-05 16:32:33,031 - MainThread _query_context_cache.py:274 - log_cache_entries() - DEBUG - Cache Entry: (0, 143347974522766, 0)
2024-04-05 16:32:33,031 - MainThread cursor.py:841 - execute() - DEBUG - sfqid: 01b379c4-0001-eb6e-0002-a8da0001904e
2024-04-05 16:32:33,031 - MainThread cursor.py:847 - execute() - INFO - query execution done
2024-04-05 16:32:33,031 - MainThread cursor.py:861 - execute() - DEBUG - SUCCESS
2024-04-05 16:32:33,031 - MainThread cursor.py:880 - execute() - DEBUG - PUT OR GET: False
2024-04-05 16:32:33,031 - MainThread cursor.py:975 - _init_result_and_meta() - DEBUG - Query result format: json
2024-04-05 16:32:33,032 - MainThread result_batch.py:512 - _parse() - DEBUG - parsing for result batch id: 1
2024-04-05 16:32:33,050 - MainThread connection.py:774 - cursor() - DEBUG - cursor
2024-04-05 16:32:33,054 - MainThread cursor.py:766 - execute() - DEBUG - executing SQL/command
2024-04-05 16:32:33,054 - MainThread connection.py:1488 - _process_params_dict() - DEBUG - parameters: {'date': "'2024-03-07T00:00:00-06:00'", 'description': "'Interior / exterior remodel'", 'status': "'Permit Issued'", 'type': "'Building Permit'", 'url': "'https://developdallas.dallascityhall.com/Default.aspx?PossePresentation=MasterPermitPublic&PosseObjectId=188352446'", 'job_value': '0.0', 'tags': "'TEST'", 'file_date': "'2024-03-07T00:00:00-06:00'", 'issue_date': "'2024-03-15T00:00:00-05:00'", 'id': "'188352446'", 'placekey': "'22b@5qw-svq-nh5'", 'air_conditioning': 'FALSE', 'air_source_heat_pump': 'FALSE', 'alarm_system': 'FALSE', 'asbestos_mold_or_lead': 'FALSE', 'bathroom_remodel': 'FALSE', 'boat_dock_or_pier': 'FALSE', 'deck_or_patio': 'FALSE', 'addition': 'FALSE', 'garage': 'FALSE', 'concrete_work': 'FALSE', 'demolition': 'FALSE', 'doors': 'FALSE', 'driveway': 'FALSE', 'drywall': 'FALSE', 'efficiency': 'FALSE', 'electrical_panel_upgrade': 'FALSE', 'electrical_service_upgrade': 'FALSE', 'electrical_work': 'FALSE', 'elevator': 'FALSE', 'ev_charger': 'FALSE', 'excavation_or_grading': 'FALSE', 'exterior_siding_or_stucco': 'FALSE', 'exterior_remodel': 'TRUE', 'fence_or_wall': 'FALSE', 'flooring': 'FALSE', 'foundation': 'FALSE', 'framing': 'FALSE', 'gas': 'FALSE', 'ground_source_heat_pump': 'FALSE', 'greenhouse_or_sunroom': 'FALSE', 'heat_pump': 'FALSE', 'hvac': 'FALSE', 'induction_stove': 'FALSE', 'insulation': 'FALSE', 'interior_wall': 'FALSE', 'irrigation': 'FALSE', 'kitchen_remodel': 'FALSE', 'landscaping': 'FALSE', 'masonry': 'FALSE', 'metal_work': 'FALSE', 'new_adu': 'FALSE', 'new_construction': 'FALSE', 'new_dwelling': 'FALSE', 'plumbing': 'FALSE', 'po_box': 'FALSE', 'pool_or_spa': 'FALSE', 'porch_or_deck': 'FALSE', 'remodel': 'FALSE', 'renovation': 'FALSE', 'restoration_fire': 'FALSE', 'restoration_water': 'FALSE', 'retaining_wall': 'FALSE', 'roofing': 'FALSE', 'seawall': 'FALSE', 'septic_or_sewer': 'FALSE', 'site_work': 'FALSE', 'solar': 'FALSE', 'solar_battery_storage': 'FALSE', 'sprinkler': 'FALSE', 'tenant_improvement': 'TRUE', 'utilities': 'FALSE', 'water_heater': 'FALSE', 'wind': 'FALSE', 'windows': 'FALSE'}
2024-04-05 16:32:33,055 - MainThread cursor.py:622 - _preprocess_pyformat_query() - DEBUG - binding: [INSERT INTO permits (date, description, status, type, url, job_value, tags, file...] with input=[{'date': '2024-03-07T00:00:00-06:00', 'description': 'Interior / exterior remodel', 'status': 'Permit Issued', 'type': 'Building Permit', 'url': 'https://developdallas.dallascityhall.com/Default.aspx?PossePresentation=MasterPermitPublic&PosseObjectId=188352446', 'job_value': 0.0, 'tags': ['TEST'], 'file_date': '2024-03-07T00:00:00-06:00', 'issue_date': '2024-03-15T00:00:00-05:00', 'id': '188352446', 'placekey': '22b@5qw-svq-nh5', 'air_conditioning': False, 'air_source_heat_pump': False, 'alarm_system': False, 'asbestos_mold_or_lead': False, 'bathroom_remodel': False, 'boat_dock_or_pier': False, 'deck_or_patio': False, 'addition': False, 'garage': False, 'concrete_work': False, 'demolition': False, 'doors': False, 'driveway': False, 'drywall': False, 'efficiency': False, 'electrical_panel_upgrade': False, 'electrical_service_upgrade': False, 'electrical_work': False, 'elevator': False, 'ev_charger': False, 'excavation_or_grading': False, 'exterior_siding_or_stucco': False, 'exterior_remodel': True, 'fence_or_wall': False, 'flooring': False, 'foundation': False, 'framing': False, 'gas': False, 'ground_source_heat_pump': False, 'greenhouse_or_sunroom': False, 'heat_pump': False, 'hvac': False, 'induction_stove': False, 'insulation': False, 'interior_wall': False, 'irrigation': False, 'kitchen_remodel': False, 'landscaping': False, 'masonry': False, 'metal_work': False, 'new_adu': False, 'new_construction': False, 'new_dwelling': False, 'plumbing': False, 'po_box': False, 'pool_or_spa': False, 'porch_or_deck': False, 'remodel': False, 'renovation': False, 'restoration_fire': False, 'restoration_water': False, 'retaining_wall': False, 'roofing': False, 'seawall': False, 'septic_or_sewer': False, 'site_work': False, 'solar': False, 'solar_battery_storage': False, 'sprinkler': False, 'tenant_improvement': True, 'utilities': False, 'water_heater': False, 'wind': False, 'windows': False}], processed=[{'date': "'2024-03-07T00:00:00-06:00'", 'description': "'Interior / exterior remodel'", 'status': "'Permit Issued'", 'type': "'Building Permit'", 'url': "'https://developdallas.dallascityhall.com/Default.aspx?PossePresentation=MasterPermitPublic&PosseObjectId=188352446'", 'job_value': '0.0', 'tags': "'TEST'", 'file_date': "'2024-03-07T00:00:00-06:00'", 'issue_date': "'2024-03-15T00:00:00-05:00'", 'id': "'188352446'", 'placekey': "'22b@5qw-svq-nh5'", 'air_conditioning': 'FALSE', 'air_source_heat_pump': 'FALSE', 'alarm_system': 'FALSE', 'asbestos_mold_or_lead': 'FALSE', 'bathroom_remodel': 'FALSE', 'boat_dock_or_pier': 'FALSE', 'deck_or_patio': 'FALSE', 'addition': 'FALSE', 'garage': 'FALSE', 'concrete_work': 'FALSE', 'demolition': 'FALSE', 'doors': 'FALSE', 'driveway': 'FALSE', 'drywall': 'FALSE', 'efficiency': 'FALSE', 'electrical_panel_upgrade': 'FALSE', 'electrical_service_upgrade': 'FALSE', 'electrical_work': 'FALSE', 'elevator': 'FALSE', 'ev_charger': 'FALSE', 'excavation_or_grading': 'FALSE', 'exterior_siding_or_stucco': 'FALSE', 'exterior_remodel': 'TRUE', 'fence_or_wall': 'FALSE', 'flooring': 'FALSE', 'foundation': 'FALSE', 'framing': 'FALSE', 'gas': 'FALSE', 'ground_source_heat_pump': 'FALSE', 'greenhouse_or_sunroom': 'FALSE', 'heat_pump': 'FALSE', 'hvac': 'FALSE', 'induction_stove': 'FALSE', 'insulation': 'FALSE', 'interior_wall': 'FALSE', 'irrigation': 'FALSE', 'kitchen_remodel': 'FALSE', 'landscaping': 'FALSE', 'masonry': 'FALSE', 'metal_work': 'FALSE', 'new_adu': 'FALSE', 'new_construction': 'FALSE', 'new_dwelling': 'FALSE', 'plumbing': 'FALSE', 'po_box': 'FALSE', 'pool_or_spa': 'FALSE', 'porch_or_deck': 'FALSE', 'remodel': 'FALSE', 'renovation': 'FALSE', 'restoration_fire': 'FALSE', 'restoration_water': 'FALSE', 'retaining_wall': 'FALSE', 'roofing': 'FALSE', 'seawall': 'FALSE', 'septic_or_sewer': 'FALSE', 'site_work': 'FALSE', 'solar': 'FALSE', 'solar_battery_storage': 'FALSE', 'sprinkler': 'FALSE', 'tenant_improvement': 'TRUE', 'utilities': 'FALSE', 'water_heater': 'FALSE', 'wind': 'FALSE', 'windows': 'FALSE'}]
2024-04-05 16:32:33,055 - MainThread cursor.py:834 - execute() - INFO - query: [INSERT INTO permits (date, description, status, type, url, job_value, tags, file...]
2024-04-05 16:32:33,055 - MainThread connection.py:1534 - _next_sequence_counter() - DEBUG - sequence counter: 4
2024-04-05 16:32:33,055 - MainThread cursor.py:496 - _execute_helper() - DEBUG - Request id: 8edbfeaf-9007-44ef-89e1-427165f4c43c
2024-04-05 16:32:33,055 - MainThread cursor.py:498 - _execute_helper() - DEBUG - running query [INSERT INTO permits (date, description, status, type, url, job_value, tags, file...]
2024-04-05 16:32:33,055 - MainThread cursor.py:505 - _execute_helper() - DEBUG - is_file_transfer: True
2024-04-05 16:32:33,055 - MainThread connection.py:1197 - cmd_query() - DEBUG - _cmd_query
2024-04-05 16:32:33,055 - MainThread _query_context_cache.py:155 - serialize_to_dict() - DEBUG - serialize_to_dict() called
2024-04-05 16:32:33,055 - MainThread _query_context_cache.py:274 - log_cache_entries() - DEBUG - Cache Entry: (0, 143347974522766, 0)
2024-04-05 16:32:33,055 - MainThread _query_context_cache.py:178 - serialize_to_dict() - DEBUG - serialize_to_dict(): data to send to server {'entries': [{'id': 0, 'timestamp': 143347974522766, 'priority': 0, 'context': {}}]}
2024-04-05 16:32:33,055 - MainThread connection.py:1224 - cmd_query() - DEBUG - sql=[INSERT INTO permits (date, description, status, type, url, job_value, tags, file...], sequence_id=[4], is_file_transfer=[False]
2024-04-05 16:32:33,056 - MainThread network.py:1217 - _use_requests_session() - DEBUG - Session status for SessionPool 'gtojrgr-au98510.snowflakecomputing.com', SessionPool 1/1 active sessions
2024-04-05 16:32:33,056 - MainThread network.py:868 - _request_exec_wrapper() - DEBUG - remaining request timeout: N/A ms, retry cnt: 1
2024-04-05 16:32:33,056 - MainThread network.py:850 - add_request_guid() - DEBUG - Request guid: 2aba328a-d92a-4393-91ce-7d8446f516ce
2024-04-05 16:32:33,056 - MainThread network.py:1058 - _request_exec() - DEBUG - socket timeout: 60
2024-04-05 16:32:33,274 - MainThread connectionpool.py:474 - _make_request() - DEBUG - https://gtojrgr-au98510.snowflakecomputing.com:443 "POST /queries/v1/query-request?requestId=8edbfeaf-9007-44ef-89e1-427165f4c43c&request_guid=2aba328a-d92a-4393-91ce-7d8446f516ce HTTP/1.1" 200 419
2024-04-05 16:32:33,275 - MainThread network.py:1085 - _request_exec() - DEBUG - SUCCESS
2024-04-05 16:32:33,275 - MainThread network.py:1222 - _use_requests_session() - DEBUG - Session status for SessionPool 'gtojrgr-au98510.snowflakecomputing.com', SessionPool 0/1 active sessions
2024-04-05 16:32:33,275 - MainThread network.py:740 - _post_request() - DEBUG - ret[code] = 002023, after post request
2024-04-05 16:32:33,275 - MainThread network.py:764 - _post_request() - DEBUG - Query id: 01b379c4-0001-eb7a-0000-0002a8dae7c5
2024-04-05 16:32:33,275 - MainThread cursor.py:841 - execute() - DEBUG - sfqid: 01b379c4-0001-eb7a-0000-0002a8dae7c5
2024-04-05 16:32:33,275 - MainThread cursor.py:847 - execute() - INFO - query execution done
2024-04-05 16:32:33,275 - MainThread cursor.py:922 - execute() - DEBUG - {'data': {'internalError': False, 'errorCode': '002023', 'age': 0, 'sqlState': '22000', 'queryId': '01b379c4-0001-eb7a-0000-0002a8dae7c5', 'line': -1, 'pos': -1, 'type': 'COMPILATION'}, 'code': '002023', 'message': 'SQL compilation error:\nExpression type does not match column data type, expecting ARRAY but got VARCHAR(4) for column TAGS', 'success': False, 'headers': None}
2024-04-05 16:32:33,295 - MainThread connection.py:774 - cursor() - DEBUG - cursor
2024-04-05 16:32:33,295 - MainThread cursor.py:766 - execute() - DEBUG - executing SQL/command
2024-04-05 16:32:33,295 - MainThread cursor.py:622 - _preprocess_pyformat_query() - DEBUG - binding: [ROLLBACK] with input=[None], processed=[None]
2024-04-05 16:32:33,295 - MainThread cursor.py:834 - execute() - INFO - query: [ROLLBACK]
2024-04-05 16:32:33,295 - MainThread connection.py:1534 - _next_sequence_counter() - DEBUG - sequence counter: 5
2024-04-05 16:32:33,295 - MainThread cursor.py:496 - _execute_helper() - DEBUG - Request id: a4bd1167-61ba-46da-8373-ed40059da903
2024-04-05 16:32:33,295 - MainThread cursor.py:498 - _execute_helper() - DEBUG - running query [ROLLBACK]
2024-04-05 16:32:33,295 - MainThread cursor.py:505 - _execute_helper() - DEBUG - is_file_transfer: True
2024-04-05 16:32:33,295 - MainThread connection.py:1197 - cmd_query() - DEBUG - _cmd_query
2024-04-05 16:32:33,295 - MainThread _query_context_cache.py:155 - serialize_to_dict() - DEBUG - serialize_to_dict() called
2024-04-05 16:32:33,295 - MainThread _query_context_cache.py:274 - log_cache_entries() - DEBUG - Cache Entry: (0, 143347974522766, 0)
2024-04-05 16:32:33,296 - MainThread _query_context_cache.py:178 - serialize_to_dict() - DEBUG - serialize_to_dict(): data to send to server {'entries': [{'id': 0, 'timestamp': 143347974522766, 'priority': 0, 'context': {}}]}
2024-04-05 16:32:33,296 - MainThread connection.py:1224 - cmd_query() - DEBUG - sql=[ROLLBACK], sequence_id=[5], is_file_transfer=[False]
2024-04-05 16:32:33,297 - MainThread network.py:1217 - _use_requests_session() - DEBUG - Session status for SessionPool 'gtojrgr-au98510.snowflakecomputing.com', SessionPool 1/1 active sessions
2024-04-05 16:32:33,297 - MainThread network.py:868 - _request_exec_wrapper() - DEBUG - remaining request timeout: N/A ms, retry cnt: 1
2024-04-05 16:32:33,297 - MainThread network.py:850 - add_request_guid() - DEBUG - Request guid: 28be3234-1b97-4c9c-a259-08b4d07378da
2024-04-05 16:32:33,297 - MainThread network.py:1058 - _request_exec() - DEBUG - socket timeout: 60
2024-04-05 16:32:33,641 - MainThread connectionpool.py:474 - _make_request() - DEBUG - https://gtojrgr-au98510.snowflakecomputing.com:443 "POST /queries/v1/query-request?requestId=a4bd1167-61ba-46da-8373-ed40059da903&request_guid=28be3234-1b97-4c9c-a259-08b4d07378da HTTP/1.1" 200 None
2024-04-05 16:32:33,642 - MainThread network.py:1085 - _request_exec() - DEBUG - SUCCESS
2024-04-05 16:32:33,642 - MainThread network.py:1222 - _use_requests_session() - DEBUG - Session status for SessionPool 'gtojrgr-au98510.snowflakecomputing.com', SessionPool 0/1 active sessions
2024-04-05 16:32:33,643 - MainThread network.py:740 - _post_request() - DEBUG - ret[code] = None, after post request
2024-04-05 16:32:33,643 - MainThread network.py:764 - _post_request() - DEBUG - Query id: 01b379c4-0001-eb70-0000-0002a8dad7c9
2024-04-05 16:32:33,643 - MainThread _query_context_cache.py:189 - deserialize_json_dict() - DEBUG - deserialize_json_dict() called: data from server: {'entries': [{'id': 0, 'timestamp': 143347975100100, 'priority': 0}]}
2024-04-05 16:32:33,643 - MainThread _query_context_cache.py:274 - log_cache_entries() - DEBUG - Cache Entry: (0, 143347974522766, 0)
2024-04-05 16:32:33,643 - MainThread _query_context_cache.py:230 - deserialize_json_dict() - DEBUG - deserialize {'id': 0, 'timestamp': 143347975100100, 'priority': 0}
2024-04-05 16:32:33,643 - MainThread _query_context_cache.py:101 - _sync_priority_map() - DEBUG - sync_priority_map called priority_map size = 0, new_priority_map size = 1
2024-04-05 16:32:33,643 - MainThread _query_context_cache.py:127 - trim_cache() - DEBUG - trim_cache() called. treeSet size is 1 and cache capacity is 5
2024-04-05 16:32:33,643 - MainThread _query_context_cache.py:136 - trim_cache() - DEBUG - trim_cache() returns. treeSet size is 1 and cache capacity is 5
2024-04-05 16:32:33,643 - MainThread _query_context_cache.py:269 - deserialize_json_dict() - DEBUG - deserialize_json_dict() returns
2024-04-05 16:32:33,643 - MainThread _query_context_cache.py:274 - log_cache_entries() - DEBUG - Cache Entry: (0, 143347975100100, 0)
2024-04-05 16:32:33,644 - MainThread cursor.py:841 - execute() - DEBUG - sfqid: 01b379c4-0001-eb70-0000-0002a8dad7c9
2024-04-05 16:32:33,644 - MainThread cursor.py:847 - execute() - INFO - query execution done
2024-04-05 16:32:33,644 - MainThread cursor.py:861 - execute() - DEBUG - SUCCESS
2024-04-05 16:32:33,644 - MainThread cursor.py:880 - execute() - DEBUG - PUT OR GET: False
2024-04-05 16:32:33,644 - MainThread cursor.py:975 - _init_result_and_meta() - DEBUG - Query result format: json
2024-04-05 16:32:33,644 - MainThread result_batch.py:512 - _parse() - DEBUG - parsing for result batch id: 1
2024-04-05 16:32:33,644 - MainThread cursor.py:989 - _init_result_and_meta() - INFO - Number of results in first chunk: 1
2024-04-05 16:32:33,645 - MainThread connection.py:774 - cursor() - DEBUG - cursor
2024-04-05 16:32:33,645 - MainThread cursor.py:766 - execute() - DEBUG - executing SQL/command
2024-04-05 16:32:33,645 - MainThread cursor.py:622 - _preprocess_pyformat_query() - DEBUG - binding: [ROLLBACK] with input=[None], processed=[None]
2024-04-05 16:32:33,645 - MainThread cursor.py:834 - execute() - INFO - query: [ROLLBACK]
2024-04-05 16:32:33,645 - MainThread connection.py:1534 - _next_sequence_counter() - DEBUG - sequence counter: 6
2024-04-05 16:32:33,645 - MainThread cursor.py:496 - _execute_helper() - DEBUG - Request id: 979a33af-4544-40cf-802a-b2e0b4df5fff
2024-04-05 16:32:33,645 - MainThread cursor.py:498 - _execute_helper() - DEBUG - running query [ROLLBACK]
2024-04-05 16:32:33,645 - MainThread cursor.py:505 - _execute_helper() - DEBUG - is_file_transfer: True
2024-04-05 16:32:33,645 - MainThread connection.py:1197 - cmd_query() - DEBUG - _cmd_query
2024-04-05 16:32:33,646 - MainThread _query_context_cache.py:155 - serialize_to_dict() - DEBUG - serialize_to_dict() called
2024-04-05 16:32:33,646 - MainThread _query_context_cache.py:274 - log_cache_entries() - DEBUG - Cache Entry: (0, 143347975100100, 0)
2024-04-05 16:32:33,646 - MainThread _query_context_cache.py:178 - serialize_to_dict() - DEBUG - serialize_to_dict(): data to send to server {'entries': [{'id': 0, 'timestamp': 143347975100100, 'priority': 0, 'context': {}}]}
2024-04-05 16:32:33,646 - MainThread connection.py:1224 - cmd_query() - DEBUG - sql=[ROLLBACK], sequence_id=[6], is_file_transfer=[False]
2024-04-05 16:32:33,646 - MainThread network.py:1217 - _use_requests_session() - DEBUG - Session status for SessionPool 'gtojrgr-au98510.snowflakecomputing.com', SessionPool 1/1 active sessions
2024-04-05 16:32:33,646 - MainThread network.py:868 - _request_exec_wrapper() - DEBUG - remaining request timeout: N/A ms, retry cnt: 1
2024-04-05 16:32:33,647 - MainThread network.py:850 - add_request_guid() - DEBUG - Request guid: dafd045d-87ee-4a67-b17f-445f7e1f1dc0
2024-04-05 16:32:33,647 - MainThread network.py:1058 - _request_exec() - DEBUG - socket timeout: 60
2024-04-05 16:32:33,770 - MainThread connectionpool.py:474 - _make_request() - DEBUG - https://gtojrgr-au98510.snowflakecomputing.com:443 "POST /queries/v1/query-request?requestId=979a33af-4544-40cf-802a-b2e0b4df5fff&request_guid=dafd045d-87ee-4a67-b17f-445f7e1f1dc0 HTTP/1.1" 200 None
2024-04-05 16:32:33,771 - MainThread network.py:1085 - _request_exec() - DEBUG - SUCCESS
2024-04-05 16:32:33,772 - MainThread network.py:1222 - _use_requests_session() - DEBUG - Session status for SessionPool 'gtojrgr-au98510.snowflakecomputing.com', SessionPool 0/1 active sessions
2024-04-05 16:32:33,772 - MainThread network.py:740 - _post_request() - DEBUG - ret[code] = None, after post request
2024-04-05 16:32:33,772 - MainThread network.py:764 - _post_request() - DEBUG - Query id: 01b379c4-0001-eb7b-0002-a8da0001804e
2024-04-05 16:32:33,772 - MainThread _query_context_cache.py:189 - deserialize_json_dict() - DEBUG - deserialize_json_dict() called: data from server: {'entries': [{'id': 0, 'timestamp': 143347975316523, 'priority': 0}]}
2024-04-05 16:32:33,772 - MainThread _query_context_cache.py:274 - log_cache_entries() - DEBUG - Cache Entry: (0, 143347975100100, 0)
2024-04-05 16:32:33,772 - MainThread _query_context_cache.py:230 - deserialize_json_dict() - DEBUG - deserialize {'id': 0, 'timestamp': 143347975316523, 'priority': 0}
2024-04-05 16:32:33,772 - MainThread _query_context_cache.py:101 - _sync_priority_map() - DEBUG - sync_priority_map called priority_map size = 0, new_priority_map size = 1
2024-04-05 16:32:33,772 - MainThread _query_context_cache.py:127 - trim_cache() - DEBUG - trim_cache() called. treeSet size is 1 and cache capacity is 5
2024-04-05 16:32:33,772 - MainThread _query_context_cache.py:136 - trim_cache() - DEBUG - trim_cache() returns. treeSet size is 1 and cache capacity is 5
2024-04-05 16:32:33,772 - MainThread _query_context_cache.py:269 - deserialize_json_dict() - DEBUG - deserialize_json_dict() returns
2024-04-05 16:32:33,772 - MainThread _query_context_cache.py:274 - log_cache_entries() - DEBUG - Cache Entry: (0, 143347975316523, 0)
2024-04-05 16:32:33,773 - MainThread cursor.py:841 - execute() - DEBUG - sfqid: 01b379c4-0001-eb7b-0002-a8da0001804e
2024-04-05 16:32:33,773 - MainThread cursor.py:847 - execute() - INFO - query execution done
2024-04-05 16:32:33,773 - MainThread cursor.py:861 - execute() - DEBUG - SUCCESS
2024-04-05 16:32:33,773 - MainThread cursor.py:880 - execute() - DEBUG - PUT OR GET: False
2024-04-05 16:32:33,773 - MainThread cursor.py:975 - _init_result_and_meta() - DEBUG - Query result format: json
2024-04-05 16:32:33,773 - MainThread result_batch.py:512 - _parse() - DEBUG - parsing for result batch id: 1
2024-04-05 16:32:33,773 - MainThread cursor.py:989 - _init_result_and_meta() - INFO - Number of results in first chunk: 1
2024-04-05 16:32:33,879 - MainThread connection.py:702 - close() - INFO - closed
2024-04-05 16:32:33,879 - MainThread telemetry.py:211 - close() - DEBUG - Closing telemetry client.
2024-04-05 16:32:33,879 - MainThread connection.py:708 - close() - INFO - No async queries seem to be running, deleting session
2024-04-05 16:32:33,879 - MainThread network.py:1217 - _use_requests_session() - DEBUG - Session status for SessionPool 'gtojrgr-au98510.snowflakecomputing.com', SessionPool 1/1 active sessions
2024-04-05 16:32:33,879 - MainThread network.py:868 - _request_exec_wrapper() - DEBUG - remaining request timeout: 5000 ms, retry cnt: 1
2024-04-05 16:32:33,879 - MainThread network.py:850 - add_request_guid() - DEBUG - Request guid: 7cff4d93-3d14-480b-805c-dce17e4cab10
2024-04-05 16:32:33,879 - MainThread network.py:1058 - _request_exec() - DEBUG - socket timeout: 60
2024-04-05 16:32:33,882 - MainThread connectionpool.py:1019 - _new_conn() - DEBUG - Starting new HTTPS connection (2): gtojrgr-au98510.snowflakecomputing.com:443
2024-04-05 16:32:33,959 - MainThread ssl_wrap_socket.py:79 - ssl_wrap_socket_with_ocsp() - DEBUG - OCSP Mode: FAIL_OPEN, OCSP response cache file name: None
2024-04-05 16:32:33,959 - MainThread ocsp_snowflake.py:530 - reset_ocsp_response_cache_uri() - DEBUG - ocsp_response_cache_uri: file:///Users/zander/Library/Caches/Snowflake/ocsp_response_cache.json
2024-04-05 16:32:33,959 - MainThread ocsp_snowflake.py:533 - reset_ocsp_response_cache_uri() - DEBUG - OCSP_VALIDATION_CACHE size: 222
2024-04-05 16:32:33,959 - MainThread ocsp_snowflake.py:332 - reset_ocsp_dynamic_cache_server_url() - DEBUG - OCSP response cache server is enabled: http://ocsp.snowflakecomputing.com/ocsp_response_cache.json
2024-04-05 16:32:33,959 - MainThread ocsp_snowflake.py:345 - reset_ocsp_dynamic_cache_server_url() - DEBUG - OCSP dynamic cache server RETRY URL: None
2024-04-05 16:32:33,959 - MainThread ocsp_snowflake.py:966 - validate() - DEBUG - validating certificate: gtojrgr-au98510.snowflakecomputing.com
2024-04-05 16:32:33,959 - MainThread ocsp_asn1crypto.py:385 - extract_certificate_chain() - DEBUG - # of certificates: 3
2024-04-05 16:32:33,959 - MainThread ocsp_asn1crypto.py:390 - extract_certificate_chain() - DEBUG - subject: OrderedDict([('country_name', 'US'), ('state_or_province_name', 'California'), ('locality_name', 'San Mateo'), ('organization_name', 'Snowflake Inc.'), ('common_name', '*.us-central1.gcp.snowflakecomputing.com')]), issuer: OrderedDict([('country_name', 'US'), ('organization_name', 'DigiCert Inc'), ('common_name', 'DigiCert Global G2 TLS RSA SHA256 2020 CA1')])
2024-04-05 16:32:33,960 - MainThread ocsp_asn1crypto.py:390 - extract_certificate_chain() - DEBUG - subject: OrderedDict([('country_name', 'US'), ('organization_name', 'DigiCert Inc'), ('common_name', 'DigiCert Global G2 TLS RSA SHA256 2020 CA1')]), issuer: OrderedDict([('country_name', 'US'), ('organization_name', 'DigiCert Inc'), ('organizational_unit_name', 'www.digicert.com'), ('common_name', 'DigiCert Global Root G2')])
2024-04-05 16:32:33,960 - MainThread ocsp_asn1crypto.py:390 - extract_certificate_chain() - DEBUG - subject: OrderedDict([('country_name', 'US'), ('organization_name', 'DigiCert Inc'), ('organizational_unit_name', 'www.digicert.com'), ('common_name', 'DigiCert Global Root G2')]), issuer: OrderedDict([('country_name', 'US'), ('organization_name', 'DigiCert Inc'), ('organizational_unit_name', 'www.digicert.com'), ('common_name', 'DigiCert Global Root G2')])
2024-04-05 16:32:33,961 - MainThread ocsp_snowflake.py:730 - find_cache() - DEBUG - hit cache for subject: OrderedDict([('country_name', 'US'), ('state_or_province_name', 'California'), ('locality_name', 'San Mateo'), ('organization_name', 'Snowflake Inc.'), ('common_name', '*.us-central1.gcp.snowflakecomputing.com')])
2024-04-05 16:32:33,961 - MainThread ocsp_snowflake.py:730 - find_cache() - DEBUG - hit cache for subject: OrderedDict([('country_name', 'US'), ('organization_name', 'DigiCert Inc'), ('common_name', 'DigiCert Global G2 TLS RSA SHA256 2020 CA1')])
2024-04-05 16:32:33,962 - MainThread ocsp_snowflake.py:1023 - _validate() - DEBUG - ok
2024-04-05 16:32:34,061 - MainThread connectionpool.py:474 - _make_request() - DEBUG - https://gtojrgr-au98510.snowflakecomputing.com:443 "POST /session?delete=true&request_guid=7cff4d93-3d14-480b-805c-dce17e4cab10 HTTP/1.1" 200 76
2024-04-05 16:32:34,061 - MainThread network.py:1085 - _request_exec() - DEBUG - SUCCESS
2024-04-05 16:32:34,061 - MainThread network.py:1222 - _use_requests_session() - DEBUG - Session status for SessionPool 'gtojrgr-au98510.snowflakecomputing.com', SessionPool 0/1 active sessions
2024-04-05 16:32:34,061 - MainThread network.py:740 - _post_request() - DEBUG - ret[code] = None, after post request
2024-04-05 16:32:34,062 - MainThread _query_context_cache.py:141 - clear_cache() - DEBUG - clear_cache() called
2024-04-05 16:32:34,063 - MainThread connection.py:721 - close() - DEBUG - Session is closed
@github-actions github-actions bot changed the title Arrays not translating into proper sql SNOW-1309051: Arrays not translating into proper sql Apr 5, 2024
@sfc-gh-sghosh
Copy link

Hello @DreamwareDevelopment ,

Thanks for raising the issue, could you please share the code snippet/application/script so we can reproduce the issue.

Regards,
Sujan

@sfc-gh-sghosh sfc-gh-sghosh self-assigned this Apr 18, 2024
@sfc-gh-sghosh sfc-gh-sghosh added status-triage Issue is under initial triage and removed bug needs triage labels Apr 18, 2024
@DreamwareDevelopment
Copy link
Author

DreamwareDevelopment commented Apr 21, 2024

Sure,

from snowflake.sqlalchemy import ARRAY
from sqlmodel import SQLModel
...
def SomeModel(SQLModel, Table=True)
    tags: list[str] = Field(default=[], sa_column=Column(ARRAY))

@sfc-gh-sghosh
Copy link

sfc-gh-sghosh commented Apr 23, 2024

Hello @DreamwareDevelopment ,

With the specific version of the libraries you mentioned,
snowflake-connector-python=3.4.1
sqlalchemy-1.4.52
sqlmodel-0.0.11
snowflake-sqlalchemy==1.5.1
Python 3.11

The above code snippet throws an error for
TypeError: ARRAY() takes no arguments

Could you please check the versions of the libraries?
Snowflake currently supports sqlalchemy 1.4

Regards,
Sujaan

@sfc-gh-sghosh
Copy link

Hello @DreamwareDevelopment ,

Did you get a chance to go through the above questions, or is the issue resolved?

Regards,
Sujan

@sfc-gh-sghosh sfc-gh-sghosh added the status-information_needed Additional information is required from the reporter label May 2, 2024
@DreamwareDevelopment
Copy link
Author

Sorry for the late reply, I've been moving forward with other work and missed your response. I'm using sqlalchemy<2.0.0,>=1.4.36 in my requirements.txt

@sfc-gh-sghosh
Copy link

Thank you, @DreamwareDevelopment, for the update.

Closing the issue as its resolved.

Regards,
Sujan

@sfc-gh-sghosh sfc-gh-sghosh added status-triage_done Initial triage done, will be further handled by the driver team and removed status-information_needed Additional information is required from the reporter status-triage Issue is under initial triage labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

2 participants