Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
evangelos-dimitriadis opened this issue Jun 18, 2020 · 2 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@evangelos-dimitriadis
Copy link

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

@evangelos-dimitriadis evangelos-dimitriadis added the bug Something isn't working label Jun 18, 2020
@gijzelaerr gijzelaerr self-assigned this Jun 29, 2020
@gijzelaerr gijzelaerr added this to the 0.8 milestone Jun 29, 2020
@gijzelaerr
Copy link
Collaborator

gijzelaerr added a commit that referenced this issue Jun 30, 2020
@gijzelaerr
Copy link
Collaborator

This should be resolved in the PR and will be included in the 0.8 release

gijzelaerr added a commit that referenced this issue Jun 30, 2020
…#69)

* add dataframe tests

* working on string types

* finalize issue #62

* adjust failing test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants