Skip to content

Function load of Table class does not create table #53

Closed

Description

@dorinand

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.

Activity

  1. odinuv commented on Dec 9, 2018

    @odinuv
    Member

    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.

  2. jirkasemmler commented on Sep 29, 2026

    @jirkasemmler
    Contributor

    Closing: the docstring this issue points at was already corrected. Tables.load now reads "Load data into an existing table", and Tables.create is the method that creates a new table from a CSV file. As explained above, the two are intentionally separate because they take mostly disjoint parameters (primary key vs. incremental options) and a missing table can be a genuine error for incremental loads.

    The README now shows both methods side by side (#96) so the distinction is clear to new users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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