aws / aws/amazon-redshift-python-driver
The field names should be presented.
- 主要言語
- Python
- スター
- 220
- フォーク
- 86
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
The generated sql code for insert do not point the field names.
Then the only way to make it work is to order the field names in the dataframe.
```
if not self.__is_valid_table(table):
raise InterfaceError("Invalid table name passed to write_dataframe: {}".format(table))
sanitized_table_name: str = self.__sanitize_str(table)
arrays: list = df.values.tolist()
placeholder: str = ", ".join(["%s"] * len(arrays[0]))
sql: str = "insert into {table} values ({placeholder})".format(
table=sanitized_table_name, placeholder=placeholder
)
```
https://github.com/aws/amazon-redshift-python-driver/blob/64cbd54ef6a5e71d98ce193630d09267cc154379/redshift_connector/cursor.py#L584C1-L591C10
コントリビューションガイド
調査の方向性
redshift_connector/cursor.py のリンク先の行から始め、write_dataframe の SQL 生成を追跡します。dataframe の列名がどのように利用可能になっているかを確認し、生成された INSERT 文にフィールド名が含まれていることを検証して、結果が dataframe の列順に依存しなくなるようにします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- aws, python
- 領域
- databases
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100