Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Bulk Copy Handles Decimal Inconsistently Compared with Normal Queries

オープン
#457 コメント 3 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@Theekshna がすでに取り組んでいます。

2026年3月2日 から。

評価

この issue はまだ評価されていません。

説明

area: bulk-copy triage needed
Describe the bug

Trying to insert into a Decimal column with the new bulk_copy can throw an exception regarding mismatched decimal scale, whereas a normal insert will succeed and automatically deal with the issue. I would like to see bulk_copy work similarly and seamlessly.

To reproduce
import mssql_python
from decimal import Decimal

conn = mssql_python.connect([conn string], autocommit=True)
cur = conn.cursor()
cur.execute('create table dectest (d decimal(10, 2));')

# This next line works fine
cur.execute('insert into dectest values (?)', Decimal('123.456'))

# This line fails with the below exception
cur.bulkcopy('dectest', (Decimal('123.456'),))
Exception message
ValueError: Input decimal scale 3 exceeds target scale 2
Expected behavior

The bulkcopy should succeed and the value should be automatically rounded as it is in the insert.

主要言語
Python
スター
478
フォーク
62
平均マージ
3日 19分
マージ済み PR(30日)
28

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/mssql-python のほかの issue

microsoft/mssql-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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