Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Column type selection for BIGNUMERIC vs NUMERIC is incorrect #1164

Open
Assignees
LinchinNeenu1995
Labels
api: bigqueryIssues related to the googleapis/python-bigquery-sqlalchemy API.
@claytonjroberts

Description

@claytonjroberts

Description

There is a discrepancy between thedocumentation for numeric types and what appears when creating a numeric column:

Field [some_field] has precision [some_precision] and scale [some_scale] but precision and scale for NUMERIC must be: 0 <= precision - scale <= 29

from the BigQuery Console

Environment details

  • OS type and version:
  • Python version:Python 3.11.10
  • pip version:pip 24.0
  • sqlalchemy-bigquery version:Version: 1.12.0

Steps to reproduce

  1. Attempt to make a table with a column of typeNUMERIC withprecision=37 andscale=0 using SQLAlchemy

Code example

importsqlalchemyassafromsqlalchemy_bigquery._typesimportNUMERICengine=sa.create_engine("bigquery://")table=sa.Table("test",sa.MetaData(...),sa.Column("id",NUMERIC(37,0),primary_key=True))table.create(engine)

Stack trace

DatabaseError: (google.cloud.bigquery.dbapi.exceptions.DatabaseError) 400 POST https://bigquery.googleapis.com/bigquery/v2/projects/govis-sandbox/queries?prettyPrint=false: In NUMERIC(P, 0), P must be between1 and 29 at [3:27]

Metadata

Metadata

Labels

api: bigqueryIssues related to the googleapis/python-bigquery-sqlalchemy API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp