Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Type safety in gramex.data.[insert|update|delete] #781

@jaidevd

Description

@jaidevd

The insert, update and delete functions in gramex.data often tend to fail silently when the args provided are incorrect or incompatible.

E.g.

Suppose x is an int, then doing

gramex.data.filter(**store, args={"col_1", [x]})

returns an empty dataframe if x is not a string, even if col_1 has been designated as an integer column. I guess this is because it's meant for FormHandler HTTP requests.

Here's another example:

gramex.data.delete(**store, args={'xyz': ["1"]})

If xyz is not a column of the table, this line deletes everything in the table.

We should ideally raise TypeErrors and KeyErrors respectively when the user provides wrong args. I'll settle for a warning too.

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