Skip to content

PostgreSQL unit test tries to access non-existent 'precision' attribute #1003

@bkline

Description

@bkline

Environment

  • Python: 3.10.1
  • pyodbc: built from current HEAD of master branch
  • OS: macOS 11.6.2 (for client) Debian 10.2.1-6 (for server)
  • DB: PostgreSQL 14.1
  • driver: psqlodbcw.so 13.02.0000 (supports ODBC version 03.51)
  • unixODBC 2.3.9

Issue

The test_columns() unit test in pgtests.py tries to access row.precision for each Row object in the results set returned by the call to cursor.columns(). This results in an error for the test.

======================================================================
ERROR: test_columns (__main__.PGTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/bkline/repos/pyodbc/tests3/pgtests.py", line 575, in test_columns
    assert row.precision == 3, row.precision
AttributeError: 'pyodbc.Row' object has no attribute 'precision'

According to the documentation, precision is not a column in the rows returned by cursor.columns().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions