Skip to content

Data

Sync and async data resources: upload, query, and update rows via jobs.

DataResource

Bases: BaseResource

Synchronous access to the table data and job endpoints.

All methods raise subclasses of :class:~ineepy.exceptions.IneepyError; authentication/permission failures raise :class:~ineepy.exceptions.UnauthorizedError / :class:~ineepy.exceptions.ForbiddenError.

append(table_id, data, format, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL)

Append rows and block until the job completes.

Non-idempotent: rows are always added without deduplication.

Parameters:

Name Type Description Default
table_id str

Unique identifier of the target table.

required
data UploadContent

Bytes, a file-like object, or an iterable of bytes to upload. Async methods accept bytes or an async-iterable of bytes. Plain (non-file) iterables are sent with chunked transfer encoding, which some S3-compatible endpoints reject — prefer bytes or a file-like object for maximum compatibility.

required
format str

Format of the uploaded data (csv, parquet).

required
timeout float

Maximum time in seconds to wait for job completion.

_DEFAULT_TIMEOUT
poll_interval float

Time in seconds between job status checks.

_DEFAULT_POLL_INTERVAL

Returns:

Type Description
DataJobResponse

class:~ineepy.DataJobResponse with the final job status.

Raises:

Type Description
NotFoundError

No table with the given table_id.

JobFailedError

Server-side processing failed.

TimeoutError

Job did not complete within timeout seconds.

cross_query(request, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL)

Submit a cross-table query and block until the result is ready.

Parameters:

Name Type Description Default
request CrossQueryRequest | Mapping[str, Any]

Query specification, as a :class:~ineepy.CrossQueryRequest or an equivalent plain dict.

required
timeout float

Maximum time in seconds to wait for job completion.

_DEFAULT_TIMEOUT
poll_interval float

Time in seconds between job status checks.

_DEFAULT_POLL_INTERVAL

Returns:

Type Description
bytes

Raw bytes downloaded from the query result.

Raises:

Type Description
JobFailedError

Query job failed server-side.

TimeoutError

Job did not complete within timeout seconds.

Example::

data = client.data.cross_query({
    'table_id': 'raw.sales.orders',
    'joins': [{
        'table_id': 'raw.sales.customers',
        'left_on': 'customer_id',
        'right_on': 'id',
    }],
})

delete_rows(table_id, filters)

Delete rows matching all supplied filters (AND semantics).

Parameters:

Name Type Description Default
table_id str

Table identifier.

required
filters str | Iterable[str]

Filter expressions in field:operator:value format (a single string or an iterable of strings). At least one filter is required.

required

Raises:

Type Description
NotFoundError

No table with the given table_id.

get_download_url(job_id, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL)

Poll a query job until complete, then return the presigned URL.

The lakehouse returns a 307 Temporary Redirect with the result URL in the Location header once the query job is finished. This method returns that URL without downloading the bytes, so callers can hand it to a browser or another tool for direct download.

Parameters:

Name Type Description Default
job_id str

Job identifier.

required
timeout float

Maximum time in seconds to wait for job completion.

_DEFAULT_TIMEOUT
poll_interval float

Time in seconds between job status checks.

_DEFAULT_POLL_INTERVAL

Returns:

Type Description
str

Presigned download URL from the Location header.

Raises:

Type Description
JobFailedError

Query job failed server-side, or the redirect response was missing a Location header.

TimeoutError

Job did not complete within timeout seconds.

Example::

url = client.data.get_download_url(job_id)

get_job(job_id)

Return the current status of a data job.

Parameters:

Name Type Description Default
job_id str

Job identifier.

required

Returns:

Type Description
DataJobResponse

class:~ineepy.DataJobResponse with current job status.

Raises:

Type Description
NotFoundError

No job with the given job_id.

info(table_id)

Return snapshot statistics for a table (no data scan).

Parameters:

Name Type Description Default
table_id str

Unique identifier of the table to retrieve info for.

required

Returns:

Type Description
DatasetInfoResponse

class:~ineepy.DatasetInfoResponse containing table statistics.

Raises:

Type Description
NotFoundError

No table with the given table_id.

overwrite(table_id, data, format, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL)

Replace all table rows and block until the job completes.

Parameters:

Name Type Description Default
table_id str

Unique identifier of the target table.

required
data UploadContent

Bytes, a file-like object, or an iterable of bytes to upload. Async methods accept bytes or an async-iterable of bytes. Plain (non-file) iterables are sent with chunked transfer encoding, which some S3-compatible endpoints reject — prefer bytes or a file-like object for maximum compatibility.

required
format str

Format of the uploaded data (csv, parquet).

required
timeout float

Maximum time in seconds to wait for job completion.

_DEFAULT_TIMEOUT
poll_interval float

Time in seconds between job status checks.

_DEFAULT_POLL_INTERVAL

Returns:

Type Description
DataJobResponse

class:~ineepy.DataJobResponse with the final job status.

Raises:

Type Description
NotFoundError

No table with the given table_id.

JobFailedError

Server-side processing failed.

TimeoutError

Job did not complete within timeout seconds.

poll_download(job_id, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL)

Poll a query job until complete, then download and return bytes.

Parameters:

Name Type Description Default
job_id str

Job identifier.

required
timeout float

Maximum time in seconds to wait for job completion.

_DEFAULT_TIMEOUT
poll_interval float

Time in seconds between job status checks.

_DEFAULT_POLL_INTERVAL

Returns:

Type Description
bytes

Raw bytes downloaded from the query result.

Raises:

Type Description
JobFailedError

Query job failed server-side, or the redirect response was missing a Location header.

TimeoutError

Job did not complete within timeout seconds.

poll_download_to(job_id, path, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL)

Poll a query job, then stream the result to path.

Unlike :meth:poll_download, the result is written directly to disk without buffering the full response in memory. A failed download may leave a partial file at path — no atomic temp-file-plus-rename is performed.

Parameters:

Name Type Description Default
job_id str

Job identifier.

required
path Path | str

Destination file path (str or Path).

required
timeout float

Maximum time in seconds to wait for job completion.

_DEFAULT_TIMEOUT
poll_interval float

Time in seconds between job status checks.

_DEFAULT_POLL_INTERVAL

Returns:

Type Description
Path

The destination path, as a :class:~pathlib.Path.

Raises:

Type Description
JobFailedError

Query job failed server-side, or the redirect response was missing a Location header.

TimeoutError

Job did not complete within timeout seconds.

Example::

client.data.poll_download_to(job_id, 'orders.parquet')

query(table_id, *, filters=None, format='json', limit=None, offset=0, if_none_match=None, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL)

query(
    table_id: str,
    *,
    filters: str | Iterable[str] | None = None,
    format: Literal['json'] = 'json',
    limit: int | None = None,
    offset: int = 0,
    if_none_match: str | None = None,
    timeout: float = _DEFAULT_TIMEOUT,
    poll_interval: float = _DEFAULT_POLL_INTERVAL,
) -> QueryResponse | None
query(
    table_id: str,
    *,
    filters: str | Iterable[str] | None = None,
    format: Literal['parquet', 'csv'],
    limit: int | None = None,
    offset: int = 0,
    if_none_match: str | None = None,
    timeout: float = _DEFAULT_TIMEOUT,
    poll_interval: float = _DEFAULT_POLL_INTERVAL,
) -> bytes
query(
    table_id: str,
    *,
    filters: str | Iterable[str] | None = None,
    format: str,
    limit: int | None = None,
    offset: int = 0,
    if_none_match: str | None = None,
    timeout: float = _DEFAULT_TIMEOUT,
    poll_interval: float = _DEFAULT_POLL_INTERVAL,
) -> bytes | QueryResponse | None

Query a table and return results.

For format='json' the result is returned synchronously as a :class:~ineepy.QueryResponse with .items (list of row dicts), .metadata (pagination info including total_count), and .etag (the table's current snapshot ETag). Use limit and offset for pagination.

Pass a previously received .etag value as if_none_match to make a conditional request. When the table has not changed the server returns 304 Not Modified and this method returns None, allowing callers to skip re-processing and use a cached copy.

For parquet or csv an async job is submitted via POST /data/queries and polled; raw bytes are returned when complete. if_none_match is ignored for non-JSON formats.

Parameters:

Name Type Description Default
table_id str

Table identifier.

required
filters str | Iterable[str] | None

Filter expressions in field:operator:value format (a single string or an iterable of strings).

None
format str

Output format (json, parquet, or csv).

'json'
limit int | None

Maximum rows to return for JSON format (max 10 000; the server rejects larger values with a ValidationError).

None
offset int

Row offset for JSON format pagination.

0
if_none_match str | None

ETag from a previous :class:~ineepy.QueryResponse. When provided, the server returns 304 Not Modified and this method returns None if the data is unchanged.

None
timeout float

Maximum time in seconds to wait for job completion.

_DEFAULT_TIMEOUT
poll_interval float

Time in seconds between job status checks.

_DEFAULT_POLL_INTERVAL

Returns:

Type Description
bytes | QueryResponse | None

class:~ineepy.QueryResponse for JSON (with .etag),

bytes | QueryResponse | None

bytes for binary formats, or None when if_none_match

bytes | QueryResponse | None

matches and the data has not changed.

Raises:

Type Description
NotFoundError

No table with the given table_id.

ValidationError

limit exceeds 10 000.

JobFailedError

Query job failed server-side.

TimeoutError

Job did not complete within timeout seconds.

Example::

result = client.data.query('raw.sales.orders', limit=10)

submit_append(table_id, data, format)

Submit an append job and return the job ID without waiting.

Uses PATCH /tables/{table_id}/data — rows are always added without deduplication.

Parameters:

Name Type Description Default
table_id str

Unique identifier of the target table.

required
data UploadContent

Bytes, a file-like object, or an iterable of bytes to upload. Async methods accept bytes or an async-iterable of bytes. Plain (non-file) iterables are sent with chunked transfer encoding, which some S3-compatible endpoints reject — prefer bytes or a file-like object for maximum compatibility.

required
format str

Format of the uploaded data (csv, parquet).

required

Returns:

Type Description
str

Job ID string for later polling.

Raises:

Type Description
NotFoundError

No table with the given table_id.

submit_cross_query(request)

Submit a cross-table async query job and return the job ID.

Sends a full :class:~ineepy.CrossQueryRequest to POST /data/queries. Supports joins, nested AND/OR filter predicates, column selection, and format choice.

Parameters:

Name Type Description Default
request CrossQueryRequest | Mapping[str, Any]

Query specification, as a :class:~ineepy.CrossQueryRequest or an equivalent plain dict.

required

Returns:

Type Description
str

Job ID string for later polling with :meth:poll_download.

submit_overwrite(table_id, data, format)

Submit an overwrite job and return the job ID without waiting.

Parameters:

Name Type Description Default
table_id str

Unique identifier of the target table.

required
data UploadContent

Bytes, a file-like object, or an iterable of bytes to upload. Async methods accept bytes or an async-iterable of bytes. Plain (non-file) iterables are sent with chunked transfer encoding, which some S3-compatible endpoints reject — prefer bytes or a file-like object for maximum compatibility.

required
format str

Format of the uploaded data (csv, parquet).

required

Returns:

Type Description
str

Job ID string for later polling.

Raises:

Type Description
NotFoundError

No table with the given table_id.

submit_query(table_id, *, filters=None, format='parquet')

Submit an async query job and return the job ID without waiting.

Uses POST /data/queries for async download (parquet or csv). Simple field:operator:value filters are converted to a structured AND predicate automatically.

Parameters:

Name Type Description Default
table_id str

Table identifier.

required
filters str | Iterable[str] | None

Filter expressions in field:operator:value format (a single string or an iterable of strings).

None
format str

Output format (parquet or csv).

'parquet'

Returns:

Type Description
str

Job ID string for later polling with :meth:poll_download.

Raises:

Type Description
NotFoundError

No table with the given table_id.

submit_update(table_id, data, format, update_mode, key_columns=None)

Submit a merge/update job and return its ID without waiting.

Parameters:

Name Type Description Default
table_id str

Unique identifier of the target table.

required
data UploadContent

Bytes, a file-like object, or an iterable of bytes to upload. Async methods accept bytes or an async-iterable of bytes. Plain (non-file) iterables are sent with chunked transfer encoding, which some S3-compatible endpoints reject — prefer bytes or a file-like object for maximum compatibility.

required
format str

Format of the uploaded data (e.g. csv, parquet).

required
update_mode str

overwrite, upsert, or append. append is transparently routed to :meth:submit_append; prefer calling it directly.

required
key_columns str | Iterable[str] | None

Match column name, or an iterable of match column names, for upsert mode.

None

Returns:

Type Description
str

Job ID string for later polling.

Raises:

Type Description
NotFoundError

No table with the given table_id.

submit_upload(table_id, data, format)

Upload data and return the job ID without waiting for completion.

Obtains a presigned S3 URL from the server, PUTs data to it, and returns the job ID for later polling with :meth:get_job.

Upload is the initial load only: the server rejects it with a 409 once the table has ever ingested data (even after :meth:truncate) — use :meth:append, :meth:overwrite, or :meth:upsert for subsequent writes.

Parameters:

Name Type Description Default
table_id str

Unique identifier of the target table.

required
data UploadContent

Bytes, a file-like object, or an iterable of bytes to upload. Async methods accept bytes or an async-iterable of bytes. Plain (non-file) iterables are sent with chunked transfer encoding, which some S3-compatible endpoints reject — prefer bytes or a file-like object for maximum compatibility.

required
format str

Format of the uploaded data (e.g. csv, parquet).

required

Returns:

Type Description
str

Job ID string for later polling.

Raises:

Type Description
NotFoundError

No table with the given table_id.

ConflictError

The table already has (or has had) data.

submit_upsert(table_id, data, format, key_columns=None)

Submit an upsert job and return the job ID without waiting.

Parameters:

Name Type Description Default
table_id str

Unique identifier of the target table.

required
data UploadContent

Bytes, a file-like object, or an iterable of bytes to upload. Async methods accept bytes or an async-iterable of bytes. Plain (non-file) iterables are sent with chunked transfer encoding, which some S3-compatible endpoints reject — prefer bytes or a file-like object for maximum compatibility.

required
format str

Format of the uploaded data (csv, parquet).

required
key_columns str | Iterable[str] | None

Match column name, or an iterable of match column names, used to match existing rows.

None

Returns:

Type Description
str

Job ID string for later polling.

Raises:

Type Description
NotFoundError

No table with the given table_id.

truncate(table_id)

Delete all rows in a table (schema is preserved).

Parameters:

Name Type Description Default
table_id str

Table identifier.

required

Raises:

Type Description
NotFoundError

No table with the given table_id.

update(table_id, data, format, update_mode, key_columns=None, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL)

Merge/update data and block until the job completes.

Parameters:

Name Type Description Default
table_id str

Unique identifier of the target table.

required
data UploadContent

Bytes, a file-like object, or an iterable of bytes to upload. Async methods accept bytes or an async-iterable of bytes. Plain (non-file) iterables are sent with chunked transfer encoding, which some S3-compatible endpoints reject — prefer bytes or a file-like object for maximum compatibility.

required
format str

Format of the uploaded data (e.g. csv, parquet).

required
update_mode str

append, overwrite, or upsert.

required
key_columns str | Iterable[str] | None

Match column name, or an iterable of match column names, for upsert mode.

None
timeout float

Maximum time in seconds to wait for job completion.

_DEFAULT_TIMEOUT
poll_interval float

Time in seconds between job status checks.

_DEFAULT_POLL_INTERVAL

Returns:

Type Description
DataJobResponse

class:~ineepy.DataJobResponse containing the final job status.

Raises:

Type Description
NotFoundError

No table with the given table_id.

JobFailedError

Server-side processing failed.

TimeoutError

Job did not complete within timeout seconds.

upload(table_id, data, format, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL)

Upload data and block until the ingestion job completes.

Upload is the initial load only: the server rejects it with a 409 once the table has ever ingested data (even after :meth:truncate) — use :meth:append, :meth:overwrite, or :meth:upsert for subsequent writes.

Parameters:

Name Type Description Default
table_id str

Unique identifier of the target table.

required
data UploadContent

Bytes, a file-like object, or an iterable of bytes to upload. Async methods accept bytes or an async-iterable of bytes. Plain (non-file) iterables are sent with chunked transfer encoding, which some S3-compatible endpoints reject — prefer bytes or a file-like object for maximum compatibility.

required
format str

Format of the uploaded data (e.g. csv, parquet).

required
timeout float

Maximum time in seconds to wait for job completion.

_DEFAULT_TIMEOUT
poll_interval float

Time in seconds between job status checks.

_DEFAULT_POLL_INTERVAL

Returns:

Type Description
DataJobResponse

class:~ineepy.DataJobResponse containing the final job status.

Raises:

Type Description
NotFoundError

No table with the given table_id.

ConflictError

The table already has (or has had) data.

JobFailedError

Server-side processing failed.

TimeoutError

Job did not complete within timeout seconds.

Example::

job = client.data.upload('raw.sales.orders', csv_bytes, 'csv')

upsert(table_id, data, format, key_columns=None, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL)

Upsert data and block until the job completes.

Existing rows matched by key_columns are updated; unmatched rows are inserted.

Parameters:

Name Type Description Default
table_id str

Unique identifier of the target table.

required
data UploadContent

Bytes, a file-like object, or an iterable of bytes to upload. Async methods accept bytes or an async-iterable of bytes. Plain (non-file) iterables are sent with chunked transfer encoding, which some S3-compatible endpoints reject — prefer bytes or a file-like object for maximum compatibility.

required
format str

Format of the uploaded data (csv, parquet).

required
key_columns str | Iterable[str] | None

Match column name, or an iterable of match column names, used to match existing rows.

None
timeout float

Maximum time in seconds to wait for job completion.

_DEFAULT_TIMEOUT
poll_interval float

Time in seconds between job status checks.

_DEFAULT_POLL_INTERVAL

Returns:

Type Description
DataJobResponse

class:~ineepy.DataJobResponse with the final job status.

Raises:

Type Description
NotFoundError

No table with the given table_id.

JobFailedError

Server-side processing failed.

TimeoutError

Job did not complete within timeout seconds.

AsyncDataResource

Bases: AsyncBaseResource

Async access to the table data and job endpoints.

All methods raise subclasses of :class:~ineepy.exceptions.IneepyError; authentication/permission failures raise :class:~ineepy.exceptions.UnauthorizedError / :class:~ineepy.exceptions.ForbiddenError.

append(table_id, data, format, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL) async

Append rows and block until the job completes.

See :meth:DataResource.append for full documentation.

cross_query(request, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL) async

Submit a cross-table query and block until the result is ready.

See :meth:DataResource.cross_query for full documentation.

delete_rows(table_id, filters) async

Delete rows matching all supplied filters (AND semantics).

See :meth:DataResource.delete_rows for full documentation.

get_download_url(job_id, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL) async

Poll a query job until complete, then return the presigned URL.

See :meth:DataResource.get_download_url for full documentation.

get_job(job_id) async

Return the current status of a data job.

See :meth:DataResource.get_job for full documentation.

info(table_id) async

Return snapshot statistics for a table (no data scan).

See :meth:DataResource.info for full documentation.

overwrite(table_id, data, format, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL) async

Replace all table rows and block until the job completes.

See :meth:DataResource.overwrite for full documentation.

poll_download(job_id, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL) async

Poll a query job until complete, then download and return bytes.

See :meth:DataResource.poll_download for full documentation.

poll_download_to(job_id, path, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL) async

Poll a query job, then stream the result to path.

See :meth:DataResource.poll_download_to for full documentation.

query(table_id, *, filters=None, format='json', limit=None, offset=0, if_none_match=None, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL) async

query(
    table_id: str,
    *,
    filters: str | Iterable[str] | None = None,
    format: Literal['json'] = 'json',
    limit: int | None = None,
    offset: int = 0,
    if_none_match: str | None = None,
    timeout: float = _DEFAULT_TIMEOUT,
    poll_interval: float = _DEFAULT_POLL_INTERVAL,
) -> QueryResponse | None
query(
    table_id: str,
    *,
    filters: str | Iterable[str] | None = None,
    format: Literal['parquet', 'csv'],
    limit: int | None = None,
    offset: int = 0,
    if_none_match: str | None = None,
    timeout: float = _DEFAULT_TIMEOUT,
    poll_interval: float = _DEFAULT_POLL_INTERVAL,
) -> bytes
query(
    table_id: str,
    *,
    filters: str | Iterable[str] | None = None,
    format: str,
    limit: int | None = None,
    offset: int = 0,
    if_none_match: str | None = None,
    timeout: float = _DEFAULT_TIMEOUT,
    poll_interval: float = _DEFAULT_POLL_INTERVAL,
) -> bytes | QueryResponse | None

Query a table and return results.

See :meth:DataResource.query for full documentation.

submit_append(table_id, data, format) async

Submit an append job and return the job ID without waiting.

See :meth:DataResource.submit_append for full documentation.

submit_cross_query(request) async

Submit a cross-table async query job and return the job ID.

See :meth:DataResource.submit_cross_query for full documentation.

submit_overwrite(table_id, data, format) async

Submit an overwrite job and return the job ID without waiting.

See :meth:DataResource.submit_overwrite for full documentation.

submit_query(table_id, *, filters=None, format='parquet') async

Submit an async query job and return the job ID without waiting.

See :meth:DataResource.submit_query for full documentation.

submit_update(table_id, data, format, update_mode, key_columns=None) async

Submit a merge/update job and return its ID without waiting.

See :meth:DataResource.submit_update for full documentation.

submit_upload(table_id, data, format) async

Upload data and return the job ID without waiting for completion.

See :meth:DataResource.submit_upload for full documentation.

submit_upsert(table_id, data, format, key_columns=None) async

Submit an upsert job and return the job ID without waiting.

See :meth:DataResource.submit_upsert for full documentation.

truncate(table_id) async

Delete all rows in a table (schema is preserved).

See :meth:DataResource.truncate for full documentation.

update(table_id, data, format, update_mode, key_columns=None, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL) async

Merge/update data and block until the job completes.

See :meth:DataResource.update for full documentation.

upload(table_id, data, format, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL) async

Upload data and block until the ingestion job completes.

See :meth:DataResource.upload for full documentation.

upsert(table_id, data, format, key_columns=None, *, timeout=_DEFAULT_TIMEOUT, poll_interval=_DEFAULT_POLL_INTERVAL) async

Upsert data and block until the job completes.

See :meth:DataResource.upsert for full documentation.