aws / aws/amazon-redshift-python-driver

pandas None/NaN mappings

オープン
#251 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
220
フォーク
86
PR マージ指標
30日以内にマージされた PR はありません

説明

I'm using `write_dataframe` function to write a pandas DataFrame. My context is that this dataframe containts columns of three different types:

1. Object (string) in pandas has None as missing data
2. Int64 in pandas has np.nan as missing data
3. Floats64 in pandas has np.nan as missing data

When writing to Redshift, these values are converted as such:

- None as NULL using varchar(20) with bytedict encoding
- NaN as -9223372036854775808 using BIGINT with az64 encoding
- NaN as "NaN" using DOUBLE PRECISION with RAW encoding

When I try to query using SQL, based on the column, I have to filter with:

1. IS NULL
2. = -9223372036854775808
3. ::text = "NaN"

Is this intended? I wish to map all None/NaN values of pandas into NULL values. Is this possible?

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start at the write_dataframe entry point and reproduce the issue with object, nullable Int64, and float64 pandas columns containing None or NaN. Trace how each missing value is converted before it reaches Redshift; done means the behavior is consistent with the intended mapping to NULL, with coverage for the three reported column types.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
aws, pandas, python, sql
領域
data, databases
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。