kumoai.connector.FileUploadConnector#

class kumoai.connector.FileUploadConnector[source]#

Bases: Connector

Defines a connector to files directly uploaded to Kumo, either as ‘parquet’ or ‘csv’ (non-partitioned) data.

To get started with file upload, please first upload a table with the upload_table() method. You can then access this table behind the file upload connector as follows:

import kumoai
from kumoai.connector import upload_table

# Upload the table; assume it is stored at `/data/users.parquet`
upload_table(name="users", path="/data/users.parquet")

# Create the file upload connector:
connector = kumoai.FileUploadConnector(file_type="parquet")

# Check that the file upload connector has a `users` table:
assert connector.has_table("users")
Parameters:

file_type (str) – The file type of uploaded data. Can be either "csv" or "parquet".

__init__(file_type)[source]#

Creates the connector to uploaded files of type file_type.

property name: str#

Returns the name of the connector.

Note

If the connector does not support naming, the name refers to an internal specifier.

property source_type: DataSourceType#

Returns the data source type accessible by this connector.

has_table(name)#

Returns True if the table exists in this connector, False otherwise.

Parameters:

name (str) – The table name.

Return type:

bool

table(name)#

Returns a SourceTable object corresponding to a source table behind this connector. A source table is a view into the raw data of table name. To use a source table in Kumo, you will need to construct a Table from the source table.

Parameters:

name (str) – The table name.

Raises:

ValueError – if name does not exist in the backing connector.

Return type:

SourceTable

table_names()#

Returns a list of table names accessible through this connector.

Return type:

List[str]