You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
I was loading data with the following code for the snowflake table with lnglatGEOGRAPHY type in it.
with db_engine.begin() as conn:
stmt = f"""
SELECT {sql_columns} FROM {table_name};
"""
res = conn.execute(stmt)
df_data = res.cursor.fetch_pandas_all()
Here is the complete error list:
(01-built-object-service) ➜ 01-built-object-service (foo) ✔ pytest -vsm focus
PG HOST: localhost
PG NAME: built-object-service
PG USER: postgres
PG PORT: 5432
===================================================================================================== test session starts =====================================================================================================
platform darwin -- Python 3.8.12, pytest-7.0.1, pluggy-1.0.0 -- /Users/mkang/.local/share/virtualenvs/01-built-object-service-gvseloBk/bin/python
cachedir: .pytest_cache
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /Users/mkang/occ/prod/01-built-object-service, configfile: setup.cfg
plugins: benchmark-3.4.1, anyio-3.5.0, cov-3.0.0
collecting 111 items Snowflake connection URL: snowflake://ONEC_DEV:***@jbulliw-ug92181/CI_BUILT_OBJECT_SERVICE_TEST/public?role=sysadmin&warehouse=COMPUTE_WH
collected 158 items / 157 deselected / 1 selected
tests/pipelines/exporter_snowflake/test_exporter_snowflake.py::test_snowflake_exporter Copying file://tests/data/airports/jp/expected_output/.meta.yaml [Content-Type=application/octet-stream]...
/ [1 files][ 562.0 B/ 562.0 B]
Operation completed over 1 objects/562.0 B.
Copying file://tests/data/substations/jp/exp_sub_output/substations.parquet [Content-Type=application/octet-stream]...
- [1 files][786.2 KiB/786.2 KiB]
Operation completed over 1 objects/786.2 KiB.
2022-05-12 21:46:44,835 - MainProcess - src.pipelines.exporter_snowflake.__main__ - INFO - parsed command line args: Namespace(export_list_yaml_file_path=PosixPath('tests/data/exporter_snowflake/exporter_snowflake_list_test_samples.yaml'), input_gcs_bucket=PosixPath('built-object-service-dev'))
2022-05-12 21:46:44,854 - MainProcess - src.pipelines.exporter_snowflake.__main__ - INFO - >>> exporting substations to snowflake from gcs://built-object-service-dev/substations/jp/v0.0.0
Copying gs://built-object-service-dev/substations/jp/v0.0.0/.meta.yaml...
/ [1 files][ 562.0 B/ 562.0 B]
Operation completed over 1 objects/562.0 B.
{'uid': 'c6fac755-52b5-4868-971a-308406d4660d', 'namespace': 'built-object-service', 'name': 'airports-importer-jlsq6', 'serviceAccountName': 'built-object-service', 'creationTimestamp': '2022-04-21T17:48:22Z', 'parameters': [{'name': 'gcs-bucket', 'value': 'built-object-service-dev'}, {'name': 'input-datamon-bundle', 'value': '27zpshJwQDvUvDkqDvE1u4Vr64v'}, {'name': 'input-datamon-context', 'value': 'dev'}, {'name': 'input-datamon-repo', 'value': 'airport-JP'}, {'name': 'version', 'value': 'v1.0.0'}, {'name': 'docker-image-tag', 'value': 'v2.5.0-staging-3-gc29adea'}, {'name': 'datamon-config', 'value': 'global-onec-co-datamon-config'}]}
2022-05-12 21:46:49,769 - MainProcess - snowflake.connector.connection - INFO - Snowflake Connector for Python Version: 2.7.4, Python Version: 3.8.12, Platform: macOS-12.2.1-x86_64-i386-64bit
2022-05-12 21:46:49,769 - MainProcess - snowflake.connector.connection - 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.
2022-05-12 21:46:49,769 - MainProcess - snowflake.connector.connection - INFO - Setting use_openssl_only mode to False
2022-05-12 21:46:50,740 - MainProcess - snowflake.connector.cursor - INFO - query: [ROLLBACK]
2022-05-12 21:46:50,863 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:50,864 - MainProcess - snowflake.connector.cursor - INFO - query: [CREATE OR REPLACE TABLE temp_table ( workflow_uid TEXT, w...]
2022-05-12 21:46:51,175 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:51,176 - MainProcess - snowflake.connector.cursor - INFO - query: [INSERT INTO temp_table (workflow_uid, workflow_name, workflow_input, meta, targe...]
2022-05-12 21:46:52,404 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:52,405 - MainProcess - snowflake.connector.cursor - INFO - query: [MERGE INTO data_events USING temp_table ON data_events.workflow_uid = temp_table...]
2022-05-12 21:46:53,736 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:53,737 - MainProcess - snowflake.connector.cursor - INFO - query: [drop table temp_table;]
2022-05-12 21:46:54,135 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:54,136 - MainProcess - snowflake.connector.cursor - INFO - query: [SELECT id FROM data_events WHERE workflow_uid = 'c6fac755-52b5-4868-971a-308406d...]
2022-05-12 21:46:55,066 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[ArrowResultChunk(1)]
result_chunks: [ArrowResultChunk(1)]
##############################
2022-05-12 21:46:55,067 - MainProcess - src.pipelines.exporter_snowflake.data_events - INFO - data_event_id: 1
2022-05-12 21:46:55,067 - MainProcess - snowflake.connector.cursor - INFO - query: [COMMIT]
2022-05-12 21:46:55,186 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:55,187 - MainProcess - snowflake.connector.cursor - INFO - query: [ROLLBACK]
2022-05-12 21:46:55,304 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:55,305 - MainProcess - src.helpers.snowflake_helper - INFO - creating stage: substations, url: gcs://built-object-service-dev/substations/jp/v0.0.0
2022-05-12 21:46:55,305 - MainProcess - snowflake.connector.cursor - INFO - query: [CREATE OR REPLACE STAGE substations STORAGE_INTEGRATION = DEV_GCS_INT URL = 'gcs...]
2022-05-12 21:46:55,577 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:55,577 - MainProcess - snowflake.connector.cursor - INFO - query: [ROLLBACK]
2022-05-12 21:46:55,691 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:55,691 - MainProcess - snowflake.connector.cursor - INFO - query: [SELECT * FROM substations]
2022-05-12 21:46:55,817 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[ArrowResultChunk(0)]
result_chunks: [ArrowResultChunk(0)]
##############################
copy into substations (ID,LNGLAT,PLUSCODE,PLUSCODE4,PLUSCODE6,PLUSCODE8,SOURCE_VENDOR,COUNTRY,META,NAME,ADDRESS,ADMINISTRATIVE_AREA_LEVEL_1,INPUT_VOLT,OUTPUT_VOLT,SUBSTATION_TYPE)
from (
select $1:id,ST_MakePoint($1:longitude::REAL, $1:latitude::REAL),$1:pluscode,$1:pluscode4,$1:pluscode6,$1:pluscode8,$1:source_vendor,$1:country,$1:meta,$1:name,$1:address,$1:administrative_area_level_1,$1:input_volt,$1:output_volt,$1:substation_type
from @substations)
file_format = (type = parquet)
pattern = '.*.parquet'
FORCE = false
;
2022-05-12 21:46:55,817 - MainProcess - snowflake.connector.cursor - INFO - query: [copy into substations (ID,LNGLAT,PLUSCODE,PLUSCODE4,PLUSCODE6,PLUSCODE8,SOURCE_V...]
2022-05-12 21:46:57,220 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:57,220 - MainProcess - snowflake.connector.cursor - INFO - query: [COMMIT]
2022-05-12 21:46:57,421 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:57,421 - MainProcess - snowflake.connector.cursor - INFO - query: [ROLLBACK]
2022-05-12 21:46:57,541 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:57,541 - MainProcess - snowflake.connector.cursor - INFO - query: [UPDATE substations SET data_event_id = 1 WHERE data_event_id = 0;]
2022-05-12 21:46:58,033 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:58,033 - MainProcess - snowflake.connector.cursor - INFO - query: [COMMIT]
2022-05-12 21:46:58,241 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:58,242 - MainProcess - snowflake.connector.cursor - INFO - query: [ROLLBACK]
2022-05-12 21:46:58,348 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:58,348 - MainProcess - src.helpers.snowflake_helper - INFO - dropping stage: substations
2022-05-12 21:46:58,349 - MainProcess - snowflake.connector.cursor - INFO - query: [DROP STAGE substations]
2022-05-12 21:46:58,476 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:58,476 - MainProcess - snowflake.connector.cursor - INFO - query: [ROLLBACK]
2022-05-12 21:46:58,591 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:58,592 - MainProcess - src.pipelines.exporter_snowflake.__main__ - INFO - >>> exported substations from gcs://built-object-service-dev/substations/jp/v0.0.0 successfully
2022-05-12 21:46:58,592 - MainProcess - src.pipelines.exporter_snowflake.__main__ - INFO - >>> Export to Snowflake completed..
2022-05-12 21:46:58,592 - MainProcess - snowflake.connector.cursor - INFO - query: [SELECT * FROM substations;]
2022-05-12 21:46:58,858 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[ArrowResultChunk(0), ArrowResultChunk(data_0_0_0), ArrowResultChunk(data_0_0_1), ArrowResultChunk(data_0_0_2), ArrowResultChunk(data_0_0_3)]
result_chunks: [ArrowResultChunk(0), ArrowResultChunk(data_0_0_0), ArrowResultChunk(data_0_0_1), ArrowResultChunk(data_0_0_2), ArrowResultChunk(data_0_0_3)]
##############################
s.name: ID s.type_code: 2 s: ResultMetadata(name='ID', type_code=2, display_size=None, internal_size=16777216, precision=None, scale=None, is_nullable=False)
s.name: LNGLAT s.type_code: 14 s: ResultMetadata(name='LNGLAT', type_code=14, display_size=None, internal_size=None, precision=None, scale=None, is_nullable=True)
s.name: PLUSCODE s.type_code: 2 s: ResultMetadata(name='PLUSCODE', type_code=2, display_size=None, internal_size=16777216, precision=None, scale=None, is_nullable=False)
s.name: PLUSCODE4 s.type_code: 2 s: ResultMetadata(name='PLUSCODE4', type_code=2, display_size=None, internal_size=16777216, precision=None, scale=None, is_nullable=False)
s.name: PLUSCODE6 s.type_code: 2 s: ResultMetadata(name='PLUSCODE6', type_code=2, display_size=None, internal_size=16777216, precision=None, scale=None, is_nullable=False)
s.name: PLUSCODE8 s.type_code: 2 s: ResultMetadata(name='PLUSCODE8', type_code=2, display_size=None, internal_size=16777216, precision=None, scale=None, is_nullable=False)
s.name: SOURCE_VENDOR s.type_code: 2 s: ResultMetadata(name='SOURCE_VENDOR', type_code=2, display_size=None, internal_size=16777216, precision=None, scale=None, is_nullable=False)
s.name: COUNTRY s.type_code: 2 s: ResultMetadata(name='COUNTRY', type_code=2, display_size=None, internal_size=16777216, precision=None, scale=None, is_nullable=False)
s.name: META s.type_code: 9 s: ResultMetadata(name='META', type_code=9, display_size=None, internal_size=None, precision=None, scale=None, is_nullable=True)
s.name: NAME s.type_code: 2 s: ResultMetadata(name='NAME', type_code=2, display_size=None, internal_size=16777216, precision=None, scale=None, is_nullable=False)
s.name: ADDRESS s.type_code: 9 s: ResultMetadata(name='ADDRESS', type_code=9, display_size=None, internal_size=None, precision=None, scale=None, is_nullable=True)
s.name: ADMINISTRATIVE_AREA_LEVEL_1 s.type_code: 2 s: ResultMetadata(name='ADMINISTRATIVE_AREA_LEVEL_1', type_code=2, display_size=None, internal_size=16777216, precision=None, scale=None, is_nullable=True)
s.name: INPUT_VOLT s.type_code: 1 s: ResultMetadata(name='INPUT_VOLT', type_code=1, display_size=None, internal_size=None, precision=None, scale=None, is_nullable=True)
s.name: OUTPUT_VOLT s.type_code: 1 s: ResultMetadata(name='OUTPUT_VOLT', type_code=1, display_size=None, internal_size=None, precision=None, scale=None, is_nullable=True)
s.name: SUBSTATION_TYPE s.type_code: 2 s: ResultMetadata(name='SUBSTATION_TYPE', type_code=2, display_size=None, internal_size=16777216, precision=None, scale=None, is_nullable=True)
s.name: DATA_EVENT_ID s.type_code: 0 s: ResultMetadata(name='DATA_EVENT_ID', type_code=0, display_size=None, internal_size=None, precision=38, scale=0, is_nullable=False)
s.name: CREATED_AT s.type_code: 8 s: ResultMetadata(name='CREATED_AT', type_code=8, display_size=None, internal_size=None, precision=0, scale=9, is_nullable=False)
2022-05-12 21:46:58,859 - MainProcess - snowflake.connector.cursor - INFO - query: [ROLLBACK]
2022-05-12 21:46:58,970 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
2022-05-12 21:46:58,970 - MainProcess - snowflake.connector.cursor - INFO - query: [ROLLBACK]
2022-05-12 21:46:59,089 - MainProcess - snowflake.connector.cursor - INFO - query execution done
##############################
[JSONResultChunk(1)]
result_chunks: [JSONResultChunk(1)]
##############################
FAILED
========================================================================================================== FAILURES ===========================================================================================================
___________________________________________________________________________________________________ test_snowflake_exporter ___________________________________________________________________________________________________
@pytest.mark.focus
def test_snowflake_exporter():
bucket = "built-object-service-dev" # using dev bucket for our test, keep it simple for now
list_yaml_path = "tests/data/exporter_snowflake/exporter_snowflake_list_test_samples.yaml"
meta_path = "tests/data/airports/jp/expected_output/.meta.yaml"
with open(list_yaml_path) as file:
export_list = yaml.full_load(file)
# upload to gcs bucket
for bucket_path, _, parquet_path in export_list:
cmd = f"gsutil cp {meta_path} gs://{bucket}/{bucket_path}/"
os.system(cmd)
cmd2 = f"gsutil cp -r {parquet_path} gs://{bucket}/{bucket_path}"
os.system(cmd2)
main(
[
"--input-gcs-bucket",
bucket,
"--export-list-yaml-file-path",
list_yaml_path,
]
)
for bucket_path, table_name, parquet_path in export_list:
# delete the data in gcsbucket
cmd = f"gsutil rm -rf gs://{bucket}/{bucket_path}"
# os.system(cmd)
parquet_path = Path(parquet_path)
# actual dataframe
> dfa = get_snowflake_dataframe(
table_name,
)
tests/pipelines/exporter_snowflake/test_exporter_snowflake.py:43:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/helpers/snowflake_helper.py:122: in get_snowflake_dataframe
df_data = res.cursor.fetch_pandas_all()
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/snowflake/connector/cursor.py:998: in fetch_pandas_all
return self._result_set._fetch_pandas_all(**kwargs)
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/snowflake/connector/result_set.py:199: in _fetch_pandas_all
dataframes = list(self._fetch_pandas_batches())
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/snowflake/connector/result_set.py:195: in _fetch_pandas_batches
return self._create_iter(iter_unit=IterUnit.TABLE_UNIT, structure="pandas")
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/snowflake/connector/result_set.py:233: in _create_iter
first_batch_iter = self.batches[0].create_iter(**kwargs)
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/snowflake/connector/result_batch.py:740: in create_iter
return self._get_pandas_iter(connection=connection, **kwargs)
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/snowflake/connector/result_batch.py:722: in _get_pandas_iter
dataframe = self.to_pandas(connection=connection, **kwargs)
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/snowflake/connector/result_batch.py:714: in to_pandas
table = self.to_arrow(connection=connection)
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/snowflake/connector/result_batch.py:707: in to_arrow
return self._create_empty_table()
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/snowflake/connector/result_batch.py:697: in _create_empty_table
fields = [
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.0 = <list_iterator object at 0x1466bfc70>
fields = [
> field(s.name, FIELD_TYPE_TO_PA_TYPE[s.type_code]) for s in self.schema
]
E IndexError: list index out of range
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/snowflake/connector/result_batch.py:698: IndexError
------------------------------------------------------------------------------------------------------ Captured log call ------------------------------------------------------------------------------------------------------
INFO src.pipelines.exporter_snowflake.__main__:__main__.py:103 parsed command line args: Namespace(export_list_yaml_file_path=PosixPath('tests/data/exporter_snowflake/exporter_snowflake_list_test_samples.yaml'), input_gcs_bucket=PosixPath('built-object-service-dev'))
INFO src.pipelines.exporter_snowflake.__main__:__main__.py:47 >>> exporting substations to snowflake from gcs://built-object-service-dev/substations/jp/v0.0.0
INFO snowflake.connector.connection:connection.py:268 Snowflake Connector for Python Version: 2.7.4, Python Version: 3.8.12, Platform: macOS-12.2.1-x86_64-i386-64bit
INFO snowflake.connector.connection:connection.py:878 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.
INFO snowflake.connector.connection:connection.py:896 Setting use_openssl_only mode to False
INFO snowflake.connector.cursor:cursor.py:713 query: [ROLLBACK]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [CREATE OR REPLACE TABLE temp_table ( workflow_uid TEXT, w...]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [INSERT INTO temp_table (workflow_uid, workflow_name, workflow_input, meta, targe...]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [MERGE INTO data_events USING temp_table ON data_events.workflow_uid = temp_table...]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [drop table temp_table;]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [SELECT id FROM data_events WHERE workflow_uid = 'c6fac755-52b5-4868-971a-308406d...]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO src.pipelines.exporter_snowflake.data_events:data_events.py:112 data_event_id: 1
INFO snowflake.connector.cursor:cursor.py:713 query: [COMMIT]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [ROLLBACK]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO src.helpers.snowflake_helper:snowflake_helper.py:79 creating stage: substations, url: gcs://built-object-service-dev/substations/jp/v0.0.0
INFO snowflake.connector.cursor:cursor.py:713 query: [CREATE OR REPLACE STAGE substations STORAGE_INTEGRATION = DEV_GCS_INT URL = 'gcs...]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [ROLLBACK]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [SELECT * FROM substations]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [copy into substations (ID,LNGLAT,PLUSCODE,PLUSCODE4,PLUSCODE6,PLUSCODE8,SOURCE_V...]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [COMMIT]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [ROLLBACK]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [UPDATE substations SET data_event_id = 1 WHERE data_event_id = 0;]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [COMMIT]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [ROLLBACK]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO src.helpers.snowflake_helper:snowflake_helper.py:87 dropping stage: substations
INFO snowflake.connector.cursor:cursor.py:713 query: [DROP STAGE substations]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [ROLLBACK]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO src.pipelines.exporter_snowflake.__main__:__main__.py:97 >>> exported substations from gcs://built-object-service-dev/substations/jp/v0.0.0 successfully
INFO src.pipelines.exporter_snowflake.__main__:__main__.py:112 >>> Export to Snowflake completed..
INFO snowflake.connector.cursor:cursor.py:713 query: [SELECT * FROM substations;]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [ROLLBACK]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
INFO snowflake.connector.cursor:cursor.py:713 query: [ROLLBACK]
INFO snowflake.connector.cursor:cursor.py:737 query execution done
====================================================================================================== warnings summary =======================================================================================================
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:18
/Users/mkang/.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:18: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
PANDAS_GE_10 = str(pd.__version__) >= LooseVersion("1.0.0")
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/setuptools/_distutils/version.py:351
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/setuptools/_distutils/version.py:351
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/setuptools/_distutils/version.py:351
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/setuptools/_distutils/version.py:351
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/setuptools/_distutils/version.py:351
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/setuptools/_distutils/version.py:351
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/setuptools/_distutils/version.py:351
/Users/mkang/.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/setuptools/_distutils/version.py:351: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
other = LooseVersion(other)
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:19
/Users/mkang/.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:19: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
PANDAS_GE_11 = str(pd.__version__) >= LooseVersion("1.1.0")
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:20
/Users/mkang/.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:20: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
PANDAS_GE_115 = str(pd.__version__) >= LooseVersion("1.1.5")
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:21
/Users/mkang/.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:21: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
PANDAS_GE_12 = str(pd.__version__) >= LooseVersion("1.2.0")
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:29
/Users/mkang/.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:29: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
SHAPELY_GE_17 = str(shapely.__version__) >= LooseVersion("1.7.0")
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:30
/Users/mkang/.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:30: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
SHAPELY_GE_18 = str(shapely.__version__) >= LooseVersion("1.8")
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:31
/Users/mkang/.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:31: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
SHAPELY_GE_20 = str(shapely.__version__) >= LooseVersion("2.0")
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:227
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:227
/Users/mkang/.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:227: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
PYPROJ_LT_3 = LooseVersion(pyproj.__version__) < LooseVersion("3")
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:228
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:228
/Users/mkang/.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/geopandas/_compat.py:228: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
PYPROJ_GE_31 = LooseVersion(pyproj.__version__) >= LooseVersion("3.1")
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/sklearn/utils/multiclass.py:14
/Users/mkang/.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/sklearn/utils/multiclass.py:14: DeprecationWarning: Please use `spmatrix` from the `scipy.sparse` namespace, the `scipy.sparse.base` namespace is deprecated.
from scipy.sparse.base import spmatrix
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/sklearn/utils/optimize.py:18
/Users/mkang/.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/sklearn/utils/optimize.py:18: DeprecationWarning: Please use `line_search_wolfe2` from the `scipy.optimize` namespace, the `scipy.optimize.linesearch` namespace is deprecated.
from scipy.optimize.linesearch import line_search_wolfe2, line_search_wolfe1
../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/sklearn/utils/optimize.py:18
/Users/mkang/.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/sklearn/utils/optimize.py:18: DeprecationWarning: Please use `line_search_wolfe1` from the `scipy.optimize` namespace, the `scipy.optimize.linesearch` namespace is deprecated.
from scipy.optimize.linesearch import line_search_wolfe2, line_search_wolfe1
<frozen importlib._bootstrap>:219
<frozen importlib._bootstrap>:219: RuntimeWarning: numpy.ndarray size changed, may indicate binary incompatibility. Expected 16 from C header, got 96 from PyObject
tests/pipelines/exporter_snowflake/test_exporter_snowflake.py::test_snowflake_exporter
/Users/mkang/occ/prod/01-built-object-service/src/pipelines/exporter_snowflake/data_events.py:82: SAWarning: Dialect snowflake:snowflake will not make use of SQL compilation caching as it does not set the 'supports_statement_cache' attribute to ``True``. This can have significant performance implications including some performance degradations in comparison to prior SQLAlchemy versions. Dialect maintainers should seek to set this attribute to True after appropriate development and testing for SQLAlchemy 1.4 caching support. Alternatively, this attribute may be set to False which will disable this warning. (Background on this error at: https://sqlalche.me/e/14/cprf)
conn.execute(stmt_create_temp)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=================================================================================================== short test summary info ===================================================================================================
FAILED tests/pipelines/exporter_snowflake/test_exporter_snowflake.py::test_snowflake_exporter - IndexError: list index out of range
======================================================================================= 1 failed, 157 deselected, 23 warnings in 31.15s =======================================================================================
(01-built-object-service) ➜ 01-built-object-service (foo) ✔
What did you expect to see?
What should have happened and what happened instead?
fetch_pandas_all() should return data correctly instead of throwing Index Error:
Can you set logging to DEBUG and collect the logs?
import logging
import os
for logger_name in ('snowflake.connector',):
logger = logging.getLogger(logger_name)
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
ch.setFormatter(logging.Formatter('%(asctime)s - %(threadName)s %(filename)s:%(lineno)d - %(funcName)s() - %(levelname)s - %(message)s'))
logger.addHandler(ch)
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
IndexError: list index out of range in snowflake/connector/result_batch.py:698: IndexError
SNOW-592647: IndexError: list index out of range in snowflake/connector/result_batch.py:698: IndexError
May 19, 2022
Would it be possible for you to set a breakpoint in ../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/snowflake/connector/result_batch.py just before line 698 with for example: import pytest; pytest.set_trace() and tell us what s.type_code is right before your test crashes?
Is there any chance that you are working with GEOGRAPHY column type? Support for that was added in 2.7.4 and that would fit for your error
Would it be possible for you to set a breakpoint in ../../../.local/share/virtualenvs/01-built-object-service-gvseloBk/lib/python3.8/site-packages/snowflake/connector/result_batch.py just before line 698 with for example: import pytest; pytest.set_trace() and tell us what s.type_code is right before your test crashes?
Is there any chance that you are working with GEOGRAPHY column type? Support for that was added in 2.7.4 and that would fit for your error
Please answer these questions before submitting your issue. Thanks!
pip freeze
)?What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
Here is the complete error list:
What did you expect to see?
What should have happened and what happened instead?
Can you set logging to DEBUG and collect the logs?
The text was updated successfully, but these errors were encountered: