Upload

class Upload

Uploads are the interface for bringing data into Redivis. They are associated with a particular table, and can be created on any table belonging to an unreleased version of a dataset. Multiple uploads can be added to a table, in which case they are "stacked" together (equivalent to a union join, with mixed schemas supported).

Constructors

table.upload(upload_name)

Construct a reference to an upload. upload_name is optional, and will be inferred based on the file name if not provided (for non-file uploads, the default name will be set to the current timestamp).

Examples

See more upload examples ->

dataset = redivis.user("user_name").dataset("dataset_name", version="next")
table = dataset.table("table_name")

upload = table.upload().create(
        "./data.csv",           # Path to file, data frame, bytes, etc
        type="delimited",       # Inferred from file extension if not provided
        remove_on_fail=True,    # Remove the upload if a failure occurs
        wait_for_finish=True,   # Wait for the upload to finish processing
        raise_on_fail=True      # Raise an error on failure
    )

Attributes

table

A reference to the Table instance that constructed this upload.

properties

A dict containing the API resource representation of the upload. This will only be populated after certain methods are called, particularly the get method.

Methods

upload.create(data[, ...])

Create an upload with the provided data and/or configuration.

Delete an upload.

Check whether an upload exists.

Fetch an upload and populate upload.properties

upload.insert_rows(rows, *[, update_schema])

Insert rows into an upload of type "stream"

upload.list_variables([max_results])

List the variables associated with a given upload.

upload.to_*([max_results, *, ...])

Various methods to read data out of an imported (but not yet released) upload. Mirrors the various Table.to_* methods (e.g., upload.to_pandas_dataframe()

Last updated

Was this helpful?