Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions changelog.d/ITL-1479.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Added

- Expanded the API reference to cover public exports, added an Errors page, and
documented the `orcapod warm-cache` command. (ITL-1479)

### Changed

- `from orcapod.types import *` now imports only the documented names. Import
anything else by name. (ITL-1479)
16 changes: 15 additions & 1 deletion docs/api/databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,24 @@ introduction. Every signature and docstring on the published page comes from the
code. See site/README.md.
-->

Database backends for persistent storage of pipeline computation results.
Database backends store pipeline results. The SQLite and PostgreSQL connectors support
reads and writes through `ConnectorArrowDatabase`. The SpiralDB connector is read-only.

**Provisional.** `ExtensionAwareDatabase` is expected to be integrated more closely with
the underlying database classes (ITL-1539), so its public form may change.

::: orcapod.databases.DeltaTableDatabase

::: orcapod.databases.InMemoryArrowDatabase

::: orcapod.databases.NoOpArrowDatabase

::: orcapod.databases.ConnectorArrowDatabase

::: orcapod.databases.ExtensionAwareDatabase

::: orcapod.databases.SQLiteConnector

::: orcapod.databases.PostgreSQLConnector

::: orcapod.databases.SpiralDBConnector
133 changes: 133 additions & 0 deletions docs/api/errors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Errors

Exceptions and warnings defined in `orcapod.errors`.

## Input, schema, and value validation

These exceptions and warnings report invalid inputs, schemas, or values.

::: orcapod.errors.InputValidationError

::: orcapod.errors.DuplicateTagError

::: orcapod.errors.SchemaInconsistencyError

::: orcapod.errors.TypeIdentityError

::: orcapod.errors.RecursiveTypeError

::: orcapod.errors.CanonicalOrderError

::: orcapod.errors.UnsupportedValueError

::: orcapod.errors.ValueConversionWarning

::: orcapod.errors.UnstorableDatetimeError

::: orcapod.errors.NaiveDatetimeError

::: orcapod.errors.SubMicrosecondDatetimeError

::: orcapod.errors.InstantOutOfRangeError

::: orcapod.errors.NotADatetimeError

::: orcapod.errors.NullInNonNullableColumnError

## Sources

These exceptions and warnings report problems identifying, binding, or reading sources.

::: orcapod.errors.RowIdentifierError

::: orcapod.errors.SourceTooLargeError

::: orcapod.errors.UnboundSourceError

::: orcapod.errors.SourceSpecMismatchError

::: orcapod.errors.InconsistentSourceError

::: orcapod.errors.CursorInvalidatedError

::: orcapod.errors.SourceCheckFailedWarning

::: orcapod.errors.SourceNameWarning

::: orcapod.errors.SourceVersionWarning

::: orcapod.errors.CachedSourceIdMismatchError

::: orcapod.errors.SourceSlotNameCollisionError

## Pipeline execution

These exceptions and warnings report problems running pipelines, processing rows, or tracing results.

::: orcapod.errors.PipelineJobRequiredError

::: orcapod.errors.DataFunctionUnavailableError

::: orcapod.errors.OutputTypeError

::: orcapod.errors.NoOutputsDeclaredError

::: orcapod.errors.RowFailuresWarning

::: orcapod.errors.RestrictedAggregationWarning

::: orcapod.errors.SemiJoinIgnoredColumnWarning

::: orcapod.errors.RejoinDifferingColumnWarning

::: orcapod.errors.UpstreamFailedError

::: orcapod.errors.EmptyDataAccessError

::: orcapod.errors.EmptyDataHashMissingError

::: orcapod.errors.EphemeralResultMissingError

::: orcapod.errors.ProvenanceInconsistencyError

## Databases and connectors

These exceptions and warnings report storage, schema, and connector problems.

::: orcapod.errors.OrcapodDatabaseError

::: orcapod.errors.OrcapodDatabaseReadError

::: orcapod.errors.OrcapodDatabaseWriteError

::: orcapod.errors.StoredTableSchemaError

::: orcapod.errors.SideEffectLogDataContextError

::: orcapod.errors.OrcapodDatabaseContentWarning

::: orcapod.errors.UnstorableColumnError

::: orcapod.errors.UnstorableTableNameError

::: orcapod.errors.TableSchemaError

::: orcapod.errors.TableListingNotSupportedError

::: orcapod.errors.UnrecordedTableSchemaWarning

::: orcapod.errors.NullabilityRecordMismatchError

::: orcapod.errors.SpiralDBWriteNotSupportedError

::: orcapod.errors.SpiralDBSignInError

## Feature availability and stability

These exceptions and warnings report optional dependencies and features still in development.

::: orcapod.errors.MissingOptionalDependencyError

::: orcapod.errors.ProvisionalHashWarning

::: orcapod.errors.InDevelopmentWarning
24 changes: 24 additions & 0 deletions docs/api/function-pods.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,38 @@ Function pods wrap Python functions to transform individual data in a stream.

::: orcapod.side_effects.SideEffectPod

::: orcapod.SideEffectPodConfig

::: orcapod.side_effects.side_effect_pod

::: orcapod.side_effects.sink_pod

::: orcapod.side_effects.tap_pod

::: orcapod.side_effect_function_pod

::: orcapod.InvocationContext

::: orcapod.InvocationHashConfig

::: orcapod.core.data_function.PythonDataFunction

::: orcapod.core.data_function.CachedDataFunction

::: orcapod.core.data_function.DataFunctionBase

## Post-run hooks

::: orcapod.HookConfig

::: orcapod.InvocationStatus

::: orcapod.PodContext

::: orcapod.PostRunHook

::: orcapod.PostRunHookFn

::: orcapod.PostRunPayload

::: orcapod.RunStats
7 changes: 6 additions & 1 deletion docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ directly:
| [`PipelineJob`](pipeline.md) | A pipeline bound to sources and a database; the object you run |
| [`side_effect_pod`, `sink_pod`, `tap_pod`](function-pods.md) | Decorators for functions run for their side effects |

Everything else lives in subpackages:
The table lists the public modules alongside the top-level `orcapod` namespace.
Other modules support Orcapod internally or are covered in the concept pages.

| Subpackage | Description |
|------------|-------------|
Expand All @@ -25,4 +26,8 @@ Everything else lives in subpackages:
| [`orcapod.databases`](databases.md) | Persistent storage backends for computation results |
| [`orcapod.nodes`](nodes.md) | Pipeline graph elements, including the DB-backed job nodes |
| [`orcapod.streams`](streams.md) | Immutable (Tag, Data) sequences backed by PyArrow tables |
| [`orcapod.pipeline`](pipeline.md) | Pipelines, jobs, orchestrators, observers, and run summaries |
| [`orcapod.types`](types.md) | Core type definitions: `Schema`, `ColumnConfig`, `ContentHash`, `Condition`, `col`, `Explanation`, `Trace`, `Absence`, `Highlight` |
| [`orcapod.errors`](errors.md) | Orcapod exceptions and warnings |

See the [command-line reference](../reference/cli.md) for `orcapod warm-cache`.
4 changes: 4 additions & 0 deletions docs/api/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ Operators perform structural transformations on streams without inspecting or sy
::: orcapod.core.operators.Pick

::: orcapod.core.operators.Index

::: orcapod.operators.DropNulls

::: orcapod.operators.TagBy
18 changes: 18 additions & 0 deletions docs/api/pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,21 @@ blueprint; `PipelineJob` binds a pipeline to sources and a database and runs it.
::: orcapod.pipeline.PipelineJob

::: orcapod.pipeline.PipelineDiagram

::: orcapod.pipeline.LoadStatus

::: orcapod.pipeline.RunSummary

::: orcapod.pipeline.NodeRunSummary

::: orcapod.pipeline.SyncPipelineOrchestrator

::: orcapod.pipeline.AsyncPipelineOrchestrator

::: orcapod.pipeline.CompositeObserver

::: orcapod.pipeline.LoggingObserver

::: orcapod.pipeline.StatusObserver

::: orcapod.pipeline.DataLogger
4 changes: 4 additions & 0 deletions docs/api/sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ source id and hashes are not frozen with data context v1 (`PROVISIONAL_SOURCES`)

::: orcapod.core.sources.PostgreSQLTableSource

::: orcapod.sources.SpiralDBTableSource

::: orcapod.sources.DBTableSource

::: orcapod.core.sources.PollingSource

::: orcapod.core.sources.DerivedSource
Expand Down
4 changes: 4 additions & 0 deletions docs/api/streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ Streams are immutable sequences of (Tag, Data) pairs backed by PyArrow tables.
::: orcapod.core.streams.ArrowTableStream

::: orcapod.core.streams.StreamBase

::: orcapod.streams.StreamView

::: orcapod.streams.ViewStatus
66 changes: 66 additions & 0 deletions docs/api/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,69 @@ Core type definitions used throughout Orcapod.
::: orcapod.types.Absence

::: orcapod.types.Highlight

## Data and schema types

::: orcapod.types.DataType

::: orcapod.types.DataValue

::: orcapod.types.DataLike

::: orcapod.types.SchemaLike

::: orcapod.types.TagValue

::: orcapod.types.SourceInfoValue

::: orcapod.types.PathLike

::: orcapod.types.PathSet

::: orcapod.types.ColumnInfo

## Polling sources

::: orcapod.types.Cursor

::: orcapod.types.PollingConfig

## Pipeline execution

::: orcapod.types.OrchestratorType

::: orcapod.types.PipelineConfig

::: orcapod.types.PodConfig

::: orcapod.types.NodeConfig

::: orcapod.types.CacheMode

## Files and directories

::: orcapod.File

::: orcapod.Directory

::: orcapod.enable_file_hash_caching

## Custom types and extensions

::: orcapod.dataclass

::: orcapod.OrcapodExtension

::: orcapod.register_extension

## Configuration

::: orcapod.OrcapodConfig

::: orcapod.DisplayConfig

::: orcapod.HashingConfig

::: orcapod.DEFAULT_CONFIG

::: orcapod.load_config
35 changes: 35 additions & 0 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Command-line reference

## `orcapod warm-cache`

Run `orcapod warm-cache PATH` to fill the SQLite file-hash cache before a pipeline run.
The command scans the directory at `PATH` recursively, skips symbolic links, and
hashes files that meet the minimum size and lack a cache entry. It reports how many files
it hashed, found in the cache, skipped by size, or could not process.

| Option | Meaning |
| --- | --- |
| `--min-size MB` | Minimum file size, in units of 1,048,576 bytes. Defaults to `500`. |
| `--db-path PATH` | Local SQLite cache path. Defaults to `ORCAPOD_HASH_CACHE_DB` if set, or `~/.orcapod/file_hash_cache.db`. |
| `--algorithm NAME` | Content hash algorithm. Defaults to `sha256`. |
| `--buffer-size BYTES` | Read buffer size in bytes. Defaults to `65536`. |
| `--workers COUNT` | Number of hashing threads. Defaults to `4`, with a minimum of `1`. |
| `--dry-run` | Count files that would be hashed. The scan runs serially and writes no hash entries. Opening the database can initialize a new cache file. |
| `--force` | Hash eligible files again, even when they already have a cache entry. With `--dry-run`, include those files in the count. |

!!! warning "Use one hash algorithm per cache"
The cache keys entries by path, modification time, and size. A matching entry
can return a digest from a different algorithm (ITL-1488). Use the same
algorithm in `warm-cache` and in every pipeline that uses that cache. The
default file hasher uses `sha256`. When changing algorithms, clear the
cache before using it again or use a new cache file.

To preview and then warm the same cache, run:

```sh
orcapod warm-cache ./recordings --min-size 100 --dry-run
orcapod warm-cache ./recordings --min-size 100
```

Enable [file hash caching](../concepts/file-hash-caching.md) in your Python process
before the pipeline hashes files. Use the same SQLite cache path as the command.
2 changes: 2 additions & 0 deletions site/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export default defineConfig({
page('Nodes', 'api/nodes'),
page('Pipeline', 'api/pipeline'),
page('Types', 'api/types'),
page('Errors', 'api/errors'),
],
},
{
Expand All @@ -198,6 +199,7 @@ export default defineConfig({
page('Golden hashes', 'reference/golden-hashes'),
page('Data function types', 'reference/data-function-types'),
page('Data types per database', 'reference/database-types'),
page('Command-line reference', 'reference/cli'),
],
},
page('Troubleshooting', 'troubleshooting'),
Expand Down
Loading
Loading