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 |
required |
format
|
str
|
Format of the uploaded data ( |
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: |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
No table with the given |
JobFailedError
|
Server-side processing failed. |
TimeoutError
|
Job did not complete within |
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: |
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 |
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 |
required |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
No table with the given |
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 |
Raises:
| Type | Description |
|---|---|
JobFailedError
|
Query job failed server-side, or the
redirect response was missing a |
TimeoutError
|
Job did not complete within |
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: |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
No job with the given |
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: |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
No table with the given |
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 |
required |
format
|
str
|
Format of the uploaded data ( |
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: |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
No table with the given |
JobFailedError
|
Server-side processing failed. |
TimeoutError
|
Job did not complete within |
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 |
TimeoutError
|
Job did not complete within |
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: |
Raises:
| Type | Description |
|---|---|
JobFailedError
|
Query job failed server-side, or the
redirect response was missing a |
TimeoutError
|
Job did not complete within |
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 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 |
None
|
format
|
str
|
Output format ( |
'json'
|
limit
|
int | None
|
Maximum rows to return for JSON format (max 10 000;
the server rejects larger values with a
|
None
|
offset
|
int
|
Row offset for JSON format pagination. |
0
|
if_none_match
|
str | None
|
ETag from a previous :class: |
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: |
bytes | QueryResponse | None
|
|
bytes | QueryResponse | None
|
matches and the data has not changed. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
No table with the given |
ValidationError
|
|
JobFailedError
|
Query job failed server-side. |
TimeoutError
|
Job did not complete within |
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 |
required |
format
|
str
|
Format of the uploaded data ( |
required |
Returns:
| Type | Description |
|---|---|
str
|
Job ID string for later polling. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
No table with the given |
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: |
required |
Returns:
| Type | Description |
|---|---|
str
|
Job ID string for later polling with :meth: |
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 |
required |
format
|
str
|
Format of the uploaded data ( |
required |
Returns:
| Type | Description |
|---|---|
str
|
Job ID string for later polling. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
No table with the given |
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 |
None
|
format
|
str
|
Output format ( |
'parquet'
|
Returns:
| Type | Description |
|---|---|
str
|
Job ID string for later polling with :meth: |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
No table with the given |
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 |
required |
format
|
str
|
Format of the uploaded data (e.g. |
required |
update_mode
|
str
|
|
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 |
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 |
required |
format
|
str
|
Format of the uploaded data (e.g. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Job ID string for later polling. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
No table with the given |
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 |
required |
format
|
str
|
Format of the uploaded data ( |
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 |
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 |
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 |
required |
format
|
str
|
Format of the uploaded data (e.g. |
required |
update_mode
|
str
|
|
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: |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
No table with the given |
JobFailedError
|
Server-side processing failed. |
TimeoutError
|
Job did not complete within |
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 |
required |
format
|
str
|
Format of the uploaded data (e.g. |
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: |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
No table with the given |
ConflictError
|
The table already has (or has had) data. |
JobFailedError
|
Server-side processing failed. |
TimeoutError
|
Job did not complete within |
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 |
required |
format
|
str
|
Format of the uploaded data ( |
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: |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
No table with the given |
JobFailedError
|
Server-side processing failed. |
TimeoutError
|
Job did not complete within |
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 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.