Skip to content

fetchdf() and fetchnumpy() do not work for all data types #62

@evangelos-dimitriadis

Description

@evangelos-dimitriadis

Describe the bug
fetchall() will return all the data by rows and it works fine.
However fetchnumpy() and fetchdf() work only with INTEGERS, FLOATS and BOOLEAN.
I tried UUID, STRING, VARCHAR, CHAR and all return the same error.

To Reproduce

import monetdbe

if __name__ == "__main__":
    conn = monetdbe.connect(':memory:')
    if not conn:
        print('Could not access the memory')

    c = conn.cursor()
    c.execute("CREATE TABLE charachters(j STRING);")
    c.execute("INSERT INTO charachters VALUES ('one'), ('two'), ('three');")
    c.execute("SELECT * FROM charachters;")

    for r in c.fetchall():
        print(r)

    c.execute("SELECT * FROM charachters")
    print(c.fetchdf())
    c.execute("SELECT * FROM charachters")
    print(c.fetchnumpy())

    c.close()
    conn.close()

Expected behavior
Print the selected fields

Software versions

  • OS and version: Ubuntu 19.04
  • Python version: 3.8
  • MonetDBe-Python version: 0.7

Additional context

The error message is:

ValueError: itemsize cannot be zero in type

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions