aws / aws/amazon-redshift-python-driver
pandas None/NaN mappings
- Ngôn ngữ chính
- Python
- Star
- 220
- Fork
- 86
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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?
Hướng dẫn đóng góp
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- aws, pandas, python, sql
- Lĩnh vực
- data, databases
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100