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 you have a time series you'd like to push to snowflake, you might have a bade time. Data pushes to the database successfully, but the date/time column is populated with "invalid times".
When you try to fetch that data, you get an error:
---------------------------------------------------------------------------
ArrowInvalid Traceback (most recent call last)
Cell In[1], line 2
1 to_snowflake(ddf.reset_index(), name="_test_dates", connection_kwargs=cnxn)
----> 2 dates = read_snowflake("select * from _test_dates", connection_kwargs=cnxn)
3 print(dates.compute())
File ~/work/sources/dask-snowflake/dask_snowflake/core.py:289, in read_snowflake(query, connection_kwargs, arrow_options, execute_params, partition_size, npartitions)
280 raise RuntimeError(
281 f"Currently only `ArrowResultBatch` are supported, but received batch types {batch_types}"
282 )
284 # Read the first non-empty batch to determine meta, which is useful for a
285 # better size estimate when partitioning. We could also allow empty meta
286 # here, which should involve less data transfer to the client, at the
287 # cost of worse size estimates. Batches seem less than 1MiB in practice,
288 # so this is likely okay right now, but could be revisited.
--> 289 meta = batches[0].to_pandas(**arrow_options)
291 batches_partitioned = _partition_batches(
292 batches, meta, npartitions=npartitions, partition_size=partition_size
293 )
295 # Create Blockwise layer
File ~/mambaforge/envs/sflake/lib/python3.10/site-packages/snowflake/connector/result_batch.py:671, in ArrowResultBatch.to_pandas(self, connection, **kwargs)
669 self._check_can_use_pandas()
670 table = self.to_arrow(connection=connection)
--> 671 return table.to_pandas(**kwargs)
File ~/mambaforge/envs/sflake/lib/python3.10/site-packages/pyarrow/array.pxi:823, in pyarrow.lib._PandasConvertible.to_pandas()
File ~/mambaforge/envs/sflake/lib/python3.10/site-packages/pyarrow/table.pxi:3913, in pyarrow.lib.Table._to_pandas()
File ~/mambaforge/envs/sflake/lib/python3.10/site-packages/pyarrow/pandas_compat.py:818, in table_to_blockmanager(options, table, categories, ignore_metadata, types_mapper)
816 _check_data_column_metadata_consistency(all_columns)
817 columns = _deserialize_column_index(table, all_columns, column_indexes)
--> 818 blocks = _table_to_blocks(options, table, categories, ext_columns_dtypes)
820 axes = [columns, index]
821 return BlockManager(blocks, axes)
File ~/mambaforge/envs/sflake/lib/python3.10/site-packages/pyarrow/pandas_compat.py:1168, in _table_to_blocks(options, block_table, categories, extension_columns)
1163 def _table_to_blocks(options, block_table, categories, extension_columns):
1164 # Part of table_to_blockmanager
1165
1166 # Convert an arrow table to Block from the internal pandas API
1167 columns = block_table.column_names
-> 1168 result = pa.lib.table_to_blocks(options, block_table, categories,
1169 list(extension_columns.keys()))
1170 return [_reconstruct_block(item, columns, extension_columns)
1171 for item in result]
File ~/mambaforge/envs/sflake/lib/python3.10/site-packages/pyarrow/table.pxi:2602, in pyarrow.lib.table_to_blocks()
File ~/mambaforge/envs/sflake/lib/python3.10/site-packages/pyarrow/error.pxi:100, in pyarrow.lib.check_status()
ArrowInvalid: Casting from timestamp[us] to timestamp[ns] would result in out of bounds timestamp: 5900852212012867584
Here's how the data appear in Snowflake
There's probably some way around this, but I have conjured it yet. I wanted to get this bug report up sooner than later. But I'll keep digging.
The text was updated successfully, but these errors were encountered:
If you have a time series you'd like to push to snowflake, you might have a bade time. Data pushes to the database successfully, but the date/time column is populated with "invalid times".
When you try to fetch that data, you get an error:
And the error you get:
Here's how the data appear in Snowflake
There's probably some way around this, but I have conjured it yet. I wanted to get this bug report up sooner than later. But I'll keep digging.
The text was updated successfully, but these errors were encountered: