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

Function load of Table class does not create table #53

Open
dorinand opened this issue Nov 19, 2018 · 1 comment
Open

Function load of Table class does not create table #53

dorinand opened this issue Nov 19, 2018 · 1 comment

Comments

@dorinand
Copy link

I am trying to import data to keboola from csv with load function in class Table. According to documentation, it should create table, if not exist:

    def load(self, table_id, file_path, is_incremental=False, delimiter=',',
             enclosure='"', escaped_by='', columns=None,
             without_headers=False):
             """
            Create a new table from CSV file.

When I trying to import data to non-exists table, I receive an error 404 Client Error: Not Found for url. Is this normal and load function should be only for update existing table ? Now, I have to check if table exist, if not, create it and than load the data. According to me, it should create the table automatically.

@odinuv
Copy link
Member

odinuv commented Dec 9, 2018

Hi,
sorry for late answer. Yes, it is as you say, the function description was indeed incorrect, sorry about that.
The load and create operations are separate because they work with somewhat disjunctive parameters (e.g. create table allows to set primary_key which doesn't make sense for load, and load takes incremental options which do not make sense for create table). Another reason is that the non-existent table might truly signal an error condition (e.g. for incremental loads) so you simply don't want to create it automatically then.

That being said, I understand your issue, and I'd like to improve the usability of the client. So I'm open to more suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants