Skip to content

Provide an implementation for avg / abs function with proper type #13049

@CaselIT

Description

@CaselIT

Describe the use case

Currently avg and abs do not have an implementation in the functions module

Since these are fairly common i thing we could provide an implementation so that the correct type can be inferred.

  • avg is numeric (or Double)
  • abs instead derives its type from the input

Databases / Backends / Drivers targeted

Postgresql but any db should apply

Example Use

assert func.abs(sa.column('a', sa.Integere).type == sa.Integer()

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    functionsdealing with sql functions, sqlalchemy.sql.functionsuse casenot really a feature or a bug; can be support for new DB features or user use cases not anticipated

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions