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

Wrong type when using sum function #85

Open
@Maveldu

Description

@Maveldu

Let's say we havemy_table.my_numeric being of numeric type.

From this query

SELECT my_numeric FROM my_table WHERE key = @key;

We have this function generated

def tmp(self, *, key: uuid.UUID) -> Optional[decimal.Decimal]:

But when a function like a sum is used

SELECT SUM(my_numeric) FROM my_table;

It's typed with an int

def tmp(self) -> Optional[int]:

Even though it actually returns a Decimal

Of course, explicit typing properly works

SELECT SUM(my_numeric)::numeric FROM my_table;
def tmp(self) -> Optional[decimal.Decimal]:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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