aito.api.upload_file
- aito.api.upload_file(client: AitoClient, table_name: str, file_path: PathLike, polling_time: int = 10, optimize_on_finished: bool = True, batch_size: int = 1000)
upload a file to the specfied table
For multitenant instances, this function uses streaming batch uploads instead of S3 file upload, as S3 file upload is not supported in multitenant environments.
Note
requires the client to be setup with the READ-WRITE API key
- Parameters:
client (AitoClient) – the AitoClient instance
table_name (str) – the name of the table
file_path (PathLike) – path to the file to be uploaded
polling_time (int) – polling wait time (only used for non-multitenant S3 upload)
optimize_on_finished (bool) –
optimize_table()when finished uploading, defaults to Truebatch_size (int) – batch size for streaming upload (only used for multitenant), defaults to 1000
- Raises:
ValueError – incorrect file extension, should be .ndjson.gz