Skip to content

Python API

airflow.providers.lamindb.flow

LaminDBFlow: an optional flow run around some of a DAG's LaminDB tasks.

A tracked LaminDB task is standalone unless it is created inside with LaminDBFlow():. On exit the block adds the flow init and finish tasks of its flow run and gives the block's tracked tasks the scope they run in. Parse-time only: no lamindb is imported, and the scope reaches the workers as the plain lamindb_scope argument of the tasks, which Airflow serializes with them.

LaminDBFlow

LaminDBFlow(scope_id: str | None = None, **flow_operator_kwargs: Any)

Group the tracked LaminDB tasks created in the block under one flow run per DAG run.

::

with DAG("pipeline"):
    standalone = extract()
    with LaminDBFlow(lamindb_version="2.11"):
        curate(extract())

Every task invocation created in the block is a member: normal and mapped ones, plain Airflow tasks and track=False tasks too, also inside task groups. A task created outside the block and only wired inside it is not. On exit the block adds a LaminDBFlowInitOperator upstream of the members that have no upstream member and a LaminDBFlowFinishOperator downstream of those that have no downstream member, paired as Airflow's setup and teardown. Tracked members are children of the flow run; the finish task marks it errored when a member failed, any map index included.

A DAG can have one default scope. More scopes need a stable scope_id, which names their tasks and flow run. Scopes can't be nested. If the block raises, nothing is wired.

Parameters:

  • scope_id (str | None, default: None ) –

    letters, digits, _ and -; None for the DAG's default scope.

  • flow_operator_kwargs (Any, default: {} ) –

    arguments of both flow operators: lamindb_conn_id, lamindb_instance, lamindb_setup, lamindb_version, requirements and any PythonVirtualenvOperator argument. Nothing is borrowed from the tasks in the block.

Source code in src/airflow/providers/lamindb/flow.py
def __init__(self, scope_id: str | None = None, **flow_operator_kwargs: Any) -> None:
    if scope_id is not None:
        validate_scope_id(scope_id)
    if reserved := sorted(set(_RESERVED) & flow_operator_kwargs.keys()):
        raise TypeError(f"LaminDBFlow sets {', '.join(reserved)} itself; don't pass them")
    self.scope_id = scope_id
    self.flow_operator_kwargs = flow_operator_kwargs
    self._dag: Any = None
    self._before: Collection[str] = ()
    self._token: Token[LaminDBFlow | None] | None = None

scope property

scope: str

The lamindb_scope of its tasks: "" for the default scope, else the id.

airflow.providers.lamindb.operators.flow

Operators that open and close a LaminDB flow run of a DAG run.

Both run lamindb inside a virtualenv, so the worker needs no lamindb. LaminDBFlow adds them to a DAG around its tasks; they do not make any task a child of the flow run by being in the DAG.

LaminDBFlowInitOperator

LaminDBFlowInitOperator(
    *,
    task_id: str | None = None,
    is_setup: bool = True,
    lamindb_conn_id: str | None = default_conn_name,
    lamindb_instance: str | None = None,
    lamindb_space: str | None = None,
    lamindb_branch: str | None = None,
    lamindb_version: str | None = None,
    lamindb_cache_dir: str | None = None,
    lamindb_setup: LaminDBSetup | None = None,
    lamindb_scope: str = DEFAULT_SCOPE,
    **kwargs: Any,
)

Bases: _LaminDBFlowOperator

Start the LaminDB flow run for this DAG run, in a virtualenv.

Creates (or restarts, on retry) a Run of the DAG file's Transform and tags it with the DAG run (and lamindb_scope) so the tasks of its LaminDBFlow scope can find it. Create the scope's tasks inside with LaminDBFlow(): to have it added and wired for you; used on its own, the operator is no parent of any task. Returns the flow run uid.

Marked as an Airflow setup task by default, pairing with the teardown LaminDBFlowFinishOperator; pass is_setup=False to opt out. Accepts every PythonVirtualenvOperator argument except python_callable, op_args and op_kwargs.

Source code in src/airflow/providers/lamindb/operators/flow.py
def __init__(
    self,
    *,
    task_id: str | None = None,
    is_setup: bool = True,
    lamindb_conn_id: str | None = LaminDBHook.default_conn_name,
    lamindb_instance: str | None = None,
    lamindb_space: str | None = None,
    lamindb_branch: str | None = None,
    lamindb_version: str | None = None,
    lamindb_cache_dir: str | None = None,
    lamindb_setup: LaminDBSetup | None = None,
    lamindb_scope: str = DEFAULT_SCOPE,
    **kwargs: Any,
) -> None:
    super().__init__(
        task_id=task_id or flow_task_ids(lamindb_scope)[0],
        lamindb_conn_id=lamindb_conn_id,
        lamindb_instance=lamindb_instance,
        lamindb_space=lamindb_space,
        lamindb_branch=lamindb_branch,
        lamindb_version=lamindb_version,
        lamindb_cache_dir=lamindb_cache_dir,
        lamindb_setup=lamindb_setup,
        lamindb_scope=lamindb_scope,
        **kwargs,
    )
    if is_setup:
        self.as_setup()

LaminDBFlowFinishOperator

LaminDBFlowFinishOperator(
    *,
    task_id: str | None = None,
    is_teardown: bool = True,
    lamindb_conn_id: str | None = default_conn_name,
    lamindb_instance: str | None = None,
    lamindb_space: str | None = None,
    lamindb_branch: str | None = None,
    lamindb_version: str | None = None,
    lamindb_cache_dir: str | None = None,
    lamindb_setup: LaminDBSetup | None = None,
    lamindb_scope: str = DEFAULT_SCOPE,
    lamindb_members: Sequence[str] | None = None,
    **kwargs: Any,
)

Bases: _LaminDBFlowOperator

Close the LaminDB flow run with the outcome of its tasks, in a virtualenv.

Marked as an Airflow teardown task by default: it runs after every other task (trigger_rule=all_done_setup_success) and is ignored when Airflow decides the DAG run state, so a failed step still fails the DAG run. Marks the flow run errored if a task failed: one of lamindb_members (all their map indexes) if given, as for the finish task of a LaminDBFlow, else any other task of the DAG run. Pass is_teardown=False together with your own trigger_rule to opt out. Accepts every PythonVirtualenvOperator argument except python_callable, op_args and op_kwargs.

Parameters:

  • lamindb_members (Sequence[str] | None, default: None ) –

    ids of the tasks whose failure fails the flow run, set by LaminDBFlow. None (default) looks at every other task of the DAG run.

Source code in src/airflow/providers/lamindb/operators/flow.py
def __init__(
    self,
    *,
    task_id: str | None = None,
    is_teardown: bool = True,
    lamindb_conn_id: str | None = LaminDBHook.default_conn_name,
    lamindb_instance: str | None = None,
    lamindb_space: str | None = None,
    lamindb_branch: str | None = None,
    lamindb_version: str | None = None,
    lamindb_cache_dir: str | None = None,
    lamindb_setup: LaminDBSetup | None = None,
    lamindb_scope: str = DEFAULT_SCOPE,
    lamindb_members: Sequence[str] | None = None,
    **kwargs: Any,
) -> None:
    if not is_teardown:
        kwargs.setdefault("trigger_rule", TriggerRule.ALL_DONE)
    super().__init__(
        task_id=task_id or flow_task_ids(lamindb_scope)[1],
        lamindb_conn_id=lamindb_conn_id,
        lamindb_instance=lamindb_instance,
        lamindb_space=lamindb_space,
        lamindb_branch=lamindb_branch,
        lamindb_version=lamindb_version,
        lamindb_cache_dir=lamindb_cache_dir,
        lamindb_setup=lamindb_setup,
        lamindb_scope=lamindb_scope,
        **kwargs,
    )
    self.lamindb_members = None if lamindb_members is None else list(lamindb_members)
    if is_teardown:
        self.as_teardown()

airflow.providers.lamindb.decorators.python_virtualenv

@task.lamindb_virtualenv: run the function as a LaminDB step inside a virtualenv.

lamindb_virtualenv_task

lamindb_virtualenv_task(
    python_callable: Callable[..., Any] | None = None,
    multiple_outputs: bool | None = None,
    **kwargs: Any,
)

@task.lamindb_virtualenv: run the function as a LaminDB step inside a virtualenv.

Accepts every @task.virtualenv argument, plus:

  • lamindb_conn_id: Airflow connection of type lamindb with the Lamin API key and the instance; default lamindb_default. The virtualenv gets them instead of the worker's ~/.lamin. None uses lamindb's own configuration instead. Templated, e.g. from an upstream task's XCom.
  • lamindb_instance: instance slug to connect to; overrides the connection's. Templated.
  • lamindb_space: name or uid of the space for the step run and the records the function saves; defaults to the flow run's space. Templated.
  • lamindb_branch: name or uid of the branch for the step run and the records the function saves; defaults to the flow run's branch. Templated.
  • lamindb_version: version of lamindb added to requirements unless you list lamindb yourself, 2.8.1 or newer; defaults to the instance's version on LaminHub (with a connection), else the latest. Templated, e.g. per mapped task.
  • lamindb_cache_dir: absolute path of a lamindb cache shared between tasks, set as LAMIN_CACHE_DIR; overrides the connection's cache_dir extra. Templated.
  • track: record the call in LaminDB. Default True; with False the function runs exactly as under @task.virtualenv, and lamindb is not added to requirements.
  • lamindb_setup: a LaminDBSetup that prepares the virtualenv: bootstrap code and environment variables resolved when the task runs. Give all LaminDB tasks of a DAG the same one, e.g. through default_args.
  • connect: with track=False, still install lamindb and connect to the instance with the connection's credentials before the function runs, without recording a step or needing a flow run. Default False.
  • lamindb_exclude_params: names of parameters (or **kwargs keys) not to record; the function still gets them.
  • lamindb_exclude_templated: "secrets" (default) doesn't record arguments whose template reads an Airflow Variable or Connection (var, conn), "all" no templated argument, "none" records them all. Arguments that contain a secret Airflow masks in logs are never recorded.

The step is standalone unless it is created inside a LaminDBFlow block. The worker needs no lamindb.

Source code in src/airflow/providers/lamindb/decorators/python_virtualenv.py
def lamindb_virtualenv_task(
    python_callable: Callable[..., Any] | None = None,
    multiple_outputs: bool | None = None,
    **kwargs: Any,
):
    """``@task.lamindb_virtualenv``: run the function as a LaminDB step inside a virtualenv.

    Accepts every ``@task.virtualenv`` argument, plus:

    - ``lamindb_conn_id``: Airflow connection of type ``lamindb`` with the Lamin API key
      and the instance; default ``lamindb_default``. The virtualenv gets them instead of
      the worker's ``~/.lamin``. ``None`` uses lamindb's own configuration instead.
      Templated, e.g. from an upstream task's XCom.
    - ``lamindb_instance``: instance slug to connect to; overrides the connection's. Templated.
    - ``lamindb_space``: name or uid of the space for the step run and the records the
      function saves; defaults to the flow run's space. Templated.
    - ``lamindb_branch``: name or uid of the branch for the step run and the records the
      function saves; defaults to the flow run's branch. Templated.
    - ``lamindb_version``: version of ``lamindb`` added to ``requirements`` unless
      you list lamindb yourself, 2.8.1 or newer; defaults to the instance's version on
      LaminHub (with a connection), else the latest. Templated, e.g. per mapped task.
    - ``lamindb_cache_dir``: absolute path of a lamindb cache shared between tasks, set as
      ``LAMIN_CACHE_DIR``; overrides the connection's ``cache_dir`` extra. Templated.
    - ``track``: record the call in LaminDB. Default ``True``; with ``False`` the
      function runs exactly as under ``@task.virtualenv``, and lamindb is not added
      to ``requirements``.
    - ``lamindb_setup``: a ``LaminDBSetup`` that prepares the virtualenv: bootstrap code and
      environment variables resolved when the task runs. Give all LaminDB tasks of a DAG
      the same one, e.g. through ``default_args``.
    - ``connect``: with ``track=False``, still install lamindb and connect to the
      instance with the connection's credentials before the function runs, without
      recording a step or needing a flow run. Default ``False``.
    - ``lamindb_exclude_params``: names of parameters (or ``**kwargs`` keys) not to
      record; the function still gets them.
    - ``lamindb_exclude_templated``: ``"secrets"`` (default) doesn't record arguments
      whose template reads an Airflow Variable or Connection (``var``, ``conn``),
      ``"all"`` no templated argument, ``"none"`` records them all. Arguments that
      contain a secret Airflow masks in logs are never recorded.

    The step is standalone unless it is created inside a ``LaminDBFlow`` block. The worker needs no
    lamindb.
    """
    reject_auto_flow(kwargs)
    # mapped steps aren't initialised when the DAG is parsed; check the [lamindb] setup_class here
    if kwargs.get("track", True) or kwargs.get("connect", False):
        resolve_setup(kwargs.get("lamindb_setup"))
    return task_decorator_factory(
        python_callable=python_callable,
        multiple_outputs=multiple_outputs,
        decorated_operator_class=LaminDBVirtualenvDecoratedOperator,
        **kwargs,
    )

airflow.providers.lamindb.decorators.kubernetes

@task.lamindb_kubernetes: run the function as a LaminDB step in a Kubernetes pod.

lamindb_kubernetes_task

lamindb_kubernetes_task(
    python_callable: Callable[..., Any] | None = None,
    multiple_outputs: bool | None = None,
    **kwargs: Any,
)

@task.lamindb_kubernetes: run the function as a LaminDB step in a Kubernetes pod.

Accepts every @task.kubernetes argument, plus lamindb_conn_id (Airflow connection of type lamindb; the pod only gets its instance, not its API key), lamindb_instance (instance slug; overrides the connection's), lamindb_space and lamindb_branch (space and branch of the step run and the records it saves; default to the flow run's, if the step is in a LaminDBFlow; all four templated), track (record the call in LaminDB; with False it runs exactly as under @task.kubernetes), connect (with track=False, still connect the pod to the instance, without recording anything), lamindb_setup (a LaminDBSetup whose bootstrap code runs in the pod), and lamindb_exclude_params and lamindb_exclude_templated (arguments not to record, as for @task.lamindb_virtualenv). The image must have lamindb 2.8.1 or newer installed (the step fails on older versions) and credentials for the instance, e.g. LAMIN_API_KEY from a Kubernetes secret. The worker needs no lamindb. Requires pip install "apache-airflow-providers-lamindb[k8s]".

The step needs the lamindb_default connection (or the one named by lamindb_conn_id) and fails if it is missing. Pass lamindb_conn_id=None to use only the pod's own lamindb configuration, together with lamindb_instance to pin the instance. The steps are standalone unless created inside a LaminDBFlow block, whose flow operators run in a virtualenv on the worker and take their own lamindb_conn_id.

Source code in src/airflow/providers/lamindb/decorators/kubernetes.py
def lamindb_kubernetes_task(
    python_callable: Callable[..., Any] | None = None,
    multiple_outputs: bool | None = None,
    **kwargs: Any,
):
    """``@task.lamindb_kubernetes``: run the function as a LaminDB step in a Kubernetes pod.

    Accepts every ``@task.kubernetes`` argument, plus ``lamindb_conn_id`` (Airflow
    connection of type ``lamindb``; the pod only gets its instance, not its API key),
    ``lamindb_instance`` (instance slug; overrides the connection's), ``lamindb_space``
    and ``lamindb_branch`` (space and branch of the step run and the records it saves; default to
    the flow run's, if the step is in a ``LaminDBFlow``; all four templated),
    ``track`` (record the call in LaminDB; with
    ``False`` it runs exactly as under ``@task.kubernetes``), ``connect`` (with ``track=False``,
    still connect the pod to the instance, without recording anything), ``lamindb_setup`` (a
    ``LaminDBSetup`` whose bootstrap code runs in the pod), and ``lamindb_exclude_params``
    and ``lamindb_exclude_templated`` (arguments not to record, as for ``@task.lamindb_virtualenv``).
    The image must have lamindb 2.8.1 or newer installed (the step fails on older versions)
    and credentials for the instance, e.g. ``LAMIN_API_KEY`` from a Kubernetes secret. The
    worker needs no lamindb. Requires
    ``pip install "apache-airflow-providers-lamindb[k8s]"``.

    The step needs the ``lamindb_default`` connection (or the one named by
    ``lamindb_conn_id``) and fails if it is missing. Pass ``lamindb_conn_id=None`` to
    use only the pod's own lamindb configuration, together with ``lamindb_instance`` to
    pin the instance. The steps are standalone unless created inside a ``LaminDBFlow`` block, whose
    flow operators run in a virtualenv on the worker and take their own ``lamindb_conn_id``.
    """
    reject_auto_flow(kwargs)
    try:
        operator_class = _lamindb_kubernetes_decorated_operator_class()
    except ImportError as e:
        raise ImportError(
            "@task.lamindb_kubernetes requires apache-airflow-providers-cncf-kubernetes. "
            'Install with: pip install "apache-airflow-providers-lamindb[k8s]"'
        ) from e

    # mapped steps aren't initialised when the DAG is parsed; check the [lamindb] setup_class here
    if kwargs.get("track", True) or kwargs.get("connect", False):
        resolve_setup(kwargs.get("lamindb_setup"))
    return task_decorator_factory(
        python_callable=python_callable,
        multiple_outputs=multiple_outputs,
        decorated_operator_class=operator_class,
        **kwargs,
    )

airflow.providers.lamindb.execution.setup

Deployment-specific preparation of the virtualenvs and pods that run lamindb.

LaminDBSetup

Deployment-specific preparation of the virtualenvs and pods that run lamindb.

Subclass it and name the subclass in the [lamindb] setup_class Airflow option, e.g. AIRFLOW__LAMINDB__SETUP_CLASS=mycompany.airflow.SiteSetup: then every LaminDB task of the installation uses it, loaded once per process. A DAG or task overrides it with a lamindb_setup instance, in default_args or as an argument; LaminDBSetup() itself does nothing, so it opts out. Wiring fails when a step needs another setup than its DAG's flow tasks run; a step that opts out needs none. Setups are equal when their class and repr are.

In a task, the steps run in this order:

  1. Airflow renders the templates.
  2. The worker resolves the lamindb connection and calls execution_env.
  3. The virtualenv is built and lamindb installed, or the pod started.
  4. In the virtualenv or pod, the bootstrap_source runs, then lamindb connects, then the task's function runs.

Airflow stores default_args in the serialized DAG through repr(). The default repr names the class, so the DAG doesn't get a new version on every parse; a subclass that takes settings should include them in its repr, so that changing them makes a new DAG version.

bootstrap_source

bootstrap_source() -> str

Python source that runs in the virtualenv or pod before lamindb is imported.

For example to point Python at a custom certificate bundle. It runs as its own module, so it may be indented or start with from __future__, and its names don't leak into the task's script. In a virtualenv it runs before Airflow unpickles the function's arguments; in a pod, after.

Source code in src/airflow/providers/lamindb/execution/setup.py
def bootstrap_source(self) -> str:
    """Python source that runs in the virtualenv or pod before lamindb is imported.

    For example to point Python at a custom certificate bundle. It runs as its own module, so it
    may be indented or start with ``from __future__``, and its names don't leak into the task's
    script. In a virtualenv it runs before Airflow unpickles the function's arguments; in a pod,
    after.
    """
    return ""

execution_env

execution_env(context: Any) -> dict[str, str]

Environment variables for a task's virtualenv, resolved on the worker when the task runs.

For example values of Airflow Variables or Connections: they are never rendered into the task's template fields. Keys and values must be strings. The provider's own lamindb variables (LAMIN_SETTINGS_DIR, LAMIN_API_KEY, LAMIN_CACHE_DIR) take precedence, and a task's own env_vars take precedence over both. context is the task's Airflow context. Pod steps don't call it: pods get their environment from the pod spec. When it fails, the flow finish task logs it and still closes the flow run.

Source code in src/airflow/providers/lamindb/execution/setup.py
def execution_env(self, context: Any) -> dict[str, str]:
    """Environment variables for a task's virtualenv, resolved on the worker when the task runs.

    For example values of Airflow Variables or Connections: they are never rendered into the
    task's template fields. Keys and values must be strings. The provider's own lamindb variables
    (``LAMIN_SETTINGS_DIR``, ``LAMIN_API_KEY``, ``LAMIN_CACHE_DIR``) take precedence, and a task's
    own ``env_vars`` take precedence over both. ``context`` is the task's Airflow context. Pod
    steps don't call it: pods get their environment from the pod spec. When it fails, the flow
    finish task logs it and still closes the flow run.
    """
    return {}

airflow.providers.lamindb.triggers.records

LaminDBRecordEventTrigger

LaminDBRecordEventTrigger(
    registry: LaminDBRegistry | str,
    *,
    events: str | Sequence[str] = ("created",),
    branch: str | int | None = "main",
    filter: FilterExpression | None = None,
    changed_fields: Sequence[str] | None = None,
    **kwargs: Any,
)

Bases: LaminDBDbWriteEventTrigger

Fire an event for every record of a LaminDB registry that is created, updated or deleted.

Use it in an AssetWatcher to schedule DAGs on LaminDB changes. Each event payload contains the event (created/updated/deleted), the current record (None for hard deletes), the previous values logged with the write, the changed_fields of updates, changed_by and the underlying dbwrite log entry.

With branch set (main by default), events are relative to that branch: created also covers records that arrive on the branch by merging a contribution branch or by restoring them from the trash or archive, and deleted also covers records moved off the branch, for example to the trash via record.delete(). For registries without branches, branch is ignored.

Parameters:

  • registry (LaminDBRegistry | str) –

    Registry to watch, e.g. LaminDBRegistry.COLLECTION, "core.run", "core.record" or "bionty.celltype".

  • events (str | Sequence[str], default: ('created',) ) –

    Events to report, any of created, updated and deleted.

  • branch (str | int | None, default: 'main' ) –

    Name or id of the branch to watch; None reports raw inserts, updates and deletes on all branches.

  • filter (FilterExpression | None, default: None ) –

    Filter the record must match, built with F, e.g. F(ArtifactField.KEY).startswith("raw/"). It's evaluated against the current record; for hard deletes against the deleted row, which only supports direct fields.

  • changed_fields (Sequence[str] | None, default: None ) –

    Only report updates that change at least one of these fields, e.g. [ArtifactField.KEY].

    Records that hold trigger cursors (see cursor_store) are never reported. They are recognized by the registry and reference_type of this trigger's own RecordCursorStore (by default core.record and airflow_trigger_cursor), so give triggers that store cursors in the registry they watch the same settings.

Source code in src/airflow/providers/lamindb/triggers/records.py
def __init__(
    self,
    registry: LaminDBRegistry | str,
    *,
    events: str | Sequence[str] = ("created",),
    branch: str | int | None = "main",
    filter: FilterExpression | None = None,
    changed_fields: Sequence[str] | None = None,
    **kwargs: Any,
) -> None:
    super().__init__(**kwargs)
    self.registry: str = plain_value(registry)
    self.events = _normalize_events(events)
    self.branch = branch
    self.filter = _restore_filter(filter)
    self.changed_fields = normalize_str_list(changed_fields) if changed_fields else None
    if "deleted" in self.events and not is_local_filter(self._record_filter()):
        raise ValueError(
            "'deleted' events only support filters on direct fields of the record "
            "(no relation or JSON paths), because deleted records can't be queried anymore."
        )
    if (
        isinstance(self.cursor_store, RecordCursorStore)
        and self.cursor_store.reference_type is None
        and normalize_registry_name(self.cursor_store.registry) == normalize_registry_name(self.registry)
    ):
        raise ValueError(
            "This trigger stores its cursor in the registry it watches, so it needs a "
            "reference_type to recognize its own saves instead of reacting to them."
        )
    self._registry: Registry | None = None
    self._branch_id: int | None = None
    # how cursor records look: this trigger's own record cursor store, or the defaults
    self._cursor_settings = (
        self.cursor_store if isinstance(self.cursor_store, RecordCursorStore) else RecordCursorStore()
    )
    self._cursor_record_ids: set[int] = set()
    self._watches_cursor_records = False

LaminDBArtifactEventTrigger

LaminDBArtifactEventTrigger(
    *,
    key: str | None = None,
    key_prefix: str | None = None,
    suffix: str | Sequence[str] | None = None,
    kind: str | Sequence[str] | None = None,
    include_internal: bool = False,
    wait_for_upload: bool = True,
    **kwargs: Any,
)

Bases: LaminDBRecordEventTrigger

Fire an event for every LaminDB artifact that is created, updated or deleted.

A specialization of LaminDBRecordEventTrigger for core.artifact. By default, the created event fires only once the artifact's upload to storage has completed (wait_for_upload), so that downstream tasks can load it right away. Artifacts that LaminDB creates internally (run logs, environments) are ignored unless include_internal is set.

Parameters:

  • key (str | None, default: None ) –

    Only artifacts with this exact key.

  • key_prefix (str | None, default: None ) –

    Only artifacts whose key starts with this prefix, e.g. "raw/".

  • suffix (str | Sequence[str] | None, default: None ) –

    Only artifacts with this suffix (or any of these suffixes), e.g. ".parquet".

  • kind (str | Sequence[str] | None, default: None ) –

    Only artifacts of this kind (or any of these kinds), e.g. ArtifactKind.DATASET.

  • include_internal (bool, default: False ) –

    Also report artifacts LaminDB creates internally.

  • wait_for_upload (bool, default: True ) –

    Report created only once the upload to storage has completed and skip updates of artifacts that are being uploaded.

  • events –
  • branch –
  • filter –

    Additional filter, see LaminDBRecordEventTrigger.

  • changed_fields –
Source code in src/airflow/providers/lamindb/triggers/records.py
def __init__(
    self,
    *,
    key: str | None = None,
    key_prefix: str | None = None,
    suffix: str | Sequence[str] | None = None,
    kind: str | Sequence[str] | None = None,
    include_internal: bool = False,
    wait_for_upload: bool = True,
    **kwargs: Any,
) -> None:
    kwargs.pop("registry", None)
    self.key = key
    self.key_prefix = key_prefix
    self.suffix = normalize_str_list(suffix)
    self.kind = normalize_str_list(kind)
    self.include_internal = include_internal
    self.wait_for_upload = wait_for_upload
    super().__init__("core.artifact", **kwargs)

airflow.providers.lamindb.triggers.branches

LaminDBBranchStatusEventTrigger

LaminDBBranchStatusEventTrigger(
    *,
    to_status: str | Sequence[str] | None = None,
    from_status: str | Sequence[str] | None = None,
    branch_name: str | Sequence[str] | None = None,
    **kwargs: Any,
)

Bases: _BranchDbWriteEventTrigger

Fire an event whenever the status of a LaminDB branch changes.

Branch statuses are standalone, draft and review (a Change Request is open), and merged and closed. The event payload contains from_status, to_status, the branch (with its current status), changed_by and the underlying dbwrite entry.

Parameters:

  • to_status (str | Sequence[str] | None, default: None ) –

    Only report transitions to this status (or any of these statuses).

  • from_status (str | Sequence[str] | None, default: None ) –

    Only report transitions from this status (or any of these statuses).

  • branch_name (str | Sequence[str] | None, default: None ) –

    Only report branches whose name matches this glob pattern (or any of these patterns), e.g. "release-*".

Source code in src/airflow/providers/lamindb/triggers/branches.py
def __init__(
    self,
    *,
    to_status: str | Sequence[str] | None = None,
    from_status: str | Sequence[str] | None = None,
    branch_name: str | Sequence[str] | None = None,
    **kwargs: Any,
) -> None:
    super().__init__(**kwargs)
    self.to_status = normalize_statuses(to_status, name="to_status")
    self.from_status = normalize_statuses(from_status, name="from_status")
    self.branch_name = normalize_str_list(branch_name)

LaminDBBranchBlockEventTrigger

LaminDBBranchBlockEventTrigger(
    *,
    kinds: str | Sequence[str] = BLOCK_KINDS,
    branch_name: str | Sequence[str] | None = None,
    **kwargs: Any,
)

Bases: _BranchDbWriteEventTrigger

Fire an event whenever a comment or readme is added to a LaminDB branch.

Comments and readmes are core.branchblock records; a new readme version is a new block. The event payload contains the kind, the block (including its Markdown content), the branch, changed_by and the underlying dbwrite entry.

Parameters:

  • kinds (str | Sequence[str], default: BLOCK_KINDS ) –

    Block kinds to report, comment and/or readme.

  • branch_name (str | Sequence[str] | None, default: None ) –

    Only report blocks on branches whose name matches this glob pattern (or any of these patterns).

Source code in src/airflow/providers/lamindb/triggers/branches.py
def __init__(
    self,
    *,
    kinds: str | Sequence[str] = BLOCK_KINDS,
    branch_name: str | Sequence[str] | None = None,
    **kwargs: Any,
) -> None:
    super().__init__(**kwargs)
    self.kinds = normalize_str_list(kinds) or []
    invalid = [kind for kind in self.kinds if kind not in BLOCK_KINDS]
    if invalid or not self.kinds:
        raise ValueError(
            f"Invalid block kinds {self.kinds}; expected a non-empty subset of {BLOCK_KINDS}"
        )
    self.branch_name = normalize_str_list(branch_name)

airflow.providers.lamindb.triggers.base

LaminDBDbWriteEventTrigger

LaminDBDbWriteEventTrigger(
    *,
    lamindb_conn_id: str | None = default_conn_name,
    instance: str | None = None,
    poll_interval: float = 30.0,
    batch_size: int = MAX_PAGE_SIZE,
    max_batches_per_poll: int = 10,
    cursor_store: CursorStore | Mapping[str, Any] | None = None,
)

Bases: BaseEventTrigger

Base class for event-driven scheduling triggers that watch the LaminHub database write log.

LaminHub logs every INSERT, UPDATE and DELETE on a LaminDB instance's database in the hubmodule.dbwrite registry ("Changes → Database writes" in the LaminHub UI). Subclasses define which writes to poll and how to turn them into trigger events.

The trigger polls writes with an id greater than its cursor, and stores the cursor under state_key so that a restarted triggerer resumes where it left off. The cursor is committed at least commit_delay seconds after the events were yielded, which gives Airflow time to persist them: events are delivered at least once. It is only committed when the trigger processed new writes. On the first start the trigger only reports writes that happen from then on.

Parameters:

  • lamindb_conn_id (str | None, default: default_conn_name ) –

    Airflow connection of type lamindb.

  • instance (str | None, default: None ) –

    LaminDB instance owner/name; overrides the connection's instance.

  • poll_interval (float, default: 30.0 ) –

    Seconds between polls of the write log.

  • batch_size (int, default: MAX_PAGE_SIZE ) –

    Number of writes fetched per request (at most 200).

  • max_batches_per_poll (int, default: 10 ) –

    Maximum number of batches processed per poll cycle.

  • cursor_store (CursorStore | Mapping[str, Any] | None, default: None ) –

    Where and how to store the cursor: AssetCursorStore (default) in the asset state store of the AssetWatcher's assets, or RecordCursorStore in a record of the watched instance. Both also set the commit_delay.

Source code in src/airflow/providers/lamindb/triggers/base.py
def __init__(
    self,
    *,
    lamindb_conn_id: str | None = LaminDBHook.default_conn_name,
    instance: str | None = None,
    poll_interval: float = 30.0,
    batch_size: int = MAX_PAGE_SIZE,
    max_batches_per_poll: int = 10,
    cursor_store: CursorStore | Mapping[str, Any] | None = None,
) -> None:
    super().__init__()
    if poll_interval <= 0:
        raise ValueError("poll_interval must be positive")
    if not 1 <= batch_size <= MAX_PAGE_SIZE:
        raise ValueError(f"batch_size must be between 1 and {MAX_PAGE_SIZE}")
    if max_batches_per_poll < 1:
        raise ValueError("max_batches_per_poll must be at least 1")
    self.lamindb_conn_id = lamindb_conn_id
    self.instance = instance
    self.poll_interval = poll_interval
    self.batch_size = batch_size
    self.max_batches_per_poll = max_batches_per_poll
    self.cursor_store = CursorStore.coerce(cursor_store)
    self._users: dict[int, UserRecordResponse] = {}

state_key property

state_key: str

Key of the cursor (and default name of its record); changes when the trigger's filters change.

airflow.providers.lamindb.triggers.cursors

Where the event triggers keep the id of the last processed database write.

Pass a trigger cursor_store=AssetCursorStore() (the default) to keep it in the watched asset's Airflow asset state store, or cursor_store=RecordCursorStore() to keep it in a record of the watched instance itself.

DEFAULT_COMMIT_DELAY module-attribute

DEFAULT_COMMIT_DELAY = 5.0

Default minimum seconds between yielding events and committing the cursor past them.

CursorStore dataclass

CursorStore(*, commit_delay: float = DEFAULT_COMMIT_DELAY)

Where and how an event trigger keeps its cursor; use a subclass.

Parameters:

  • commit_delay (float, default: DEFAULT_COMMIT_DELAY ) –

    Minimum seconds between yielding events and committing the cursor past them, which gives Airflow time to persist the events. Longer delays save less often, but redeliver more events after a crash.

coerce classmethod

coerce(value: CursorStore | Mapping[str, Any] | None) -> CursorStore

Accept a store, its serialize form (as in serialized trigger kwargs) or None.

Source code in src/airflow/providers/lamindb/triggers/cursors.py
@classmethod
def coerce(cls, value: CursorStore | Mapping[str, Any] | None) -> CursorStore:
    """Accept a store, its ``serialize`` form (as in serialized trigger kwargs) or None."""
    if value is None:
        return AssetCursorStore()
    if isinstance(value, CursorStore):
        return value
    if not isinstance(value, Mapping):
        raise TypeError(f"cursor_store must be a CursorStore, e.g. RecordCursorStore(), got {value!r}")
    settings = dict(value)
    store_type = CursorStore._types.get(settings.pop("type", None))
    if store_type is None:
        raise ValueError(f"cursor_store type must be one of {sorted(CursorStore._types)}, got {value!r}")
    unknown = set(settings) - {f.name for f in fields(store_type)}
    if unknown:
        raise ValueError(f"Unknown {store_type.__name__} settings: {sorted(unknown)}")
    return store_type(**settings)

open

open(
    *, hook: LaminDBHook, asset_state_store: Any, key: str, description: str
) -> CursorBackend

The backend that loads and saves the cursor under key while the trigger runs.

Source code in src/airflow/providers/lamindb/triggers/cursors.py
def open(self, *, hook: LaminDBHook, asset_state_store: Any, key: str, description: str) -> CursorBackend:
    """The backend that loads and saves the cursor under ``key`` while the trigger runs."""
    raise NotImplementedError

AssetCursorStore dataclass

AssetCursorStore(*, commit_delay: float = DEFAULT_COMMIT_DELAY)

Bases: CursorStore

Keep the cursor in the asset state store of the AssetWatcher's assets.

The cursor lives in Airflow's metadata database next to the asset events. A trigger outside an AssetWatcher has no asset state store and keeps its cursor in memory only.

RecordCursorStore dataclass

RecordCursorStore(
    *,
    commit_delay: float = DEFAULT_COMMIT_DELAY,
    registry: str = "core.record",
    field: str = "extra_data",
    record_type: str | None = CURSOR_RECORD_TYPE_NAME,
    reference_type: str | None = CURSOR_REFERENCE_TYPE,
    branch: str | int = "main",
    space: str | int | None = None,
    name: str | None = None,
    description: str | None = None,
)

Bases: CursorStore

Keep the cursor in a record of the watched instance; needs write access to the instance.

The defaults keep each trigger's cursor in its own core.record on main, grouped under the record type Airflow trigger cursors. The record and its type are created on the first save. Deleting the record resets the cursor when the trigger restarts; a running trigger creates the record again on its next save.

Parameters:

  • registry (str, default: 'core.record' ) –

    Registry of the cursor records. It needs the fields name, branch, space and field, plus reference_type and type/is_type unless those are disabled below.

  • field (str, default: 'extra_data' ) –

    JSON field that holds the cursor, {"dbwrite_id": ..., "instance_id": ...}.

  • record_type (str | None, default: CURSOR_RECORD_TYPE_NAME ) –

    Name of the record type (is_type=True) that groups the cursor records; None for no type, for registries without types.

  • reference_type (str | None, default: CURSOR_REFERENCE_TYPE ) –

    Marker in reference_type that identifies cursor records, so that record triggers on registry can skip them; None for no marker. Then such triggers report the cursor records like any other record. A record trigger watching registry itself needs a marker, so it rejects None.

  • branch (str | int, default: 'main' ) –

    Branch (name or id) of the cursor records and their type.

  • space (str | int | None, default: None ) –

    Space (name or id) of the cursor records and their type, e.g. a restricted space that only the Airflow API key can write to; None for LaminHub's default space.

  • name (str | None, default: None ) –

    Name of the cursor record; None for the trigger's state_key. A fixed name must be unique per trigger, or triggers overwrite each other's cursors.

  • description (str | None, default: None ) –

    Description of the cursor record; None to describe the trigger.

  • commit_delay (float, default: DEFAULT_COMMIT_DELAY ) –

airflow.providers.lamindb.sensors.branches

LaminDBBranchStatusSensor

LaminDBBranchStatusSensor(
    *,
    branch: str | int,
    target_status: str | Sequence[str] = "merged",
    failure_status: str | Sequence[str] = ("closed",),
    lamindb_conn_id: str | None = default_conn_name,
    instance: str | None = None,
    deferrable: bool = getboolean("operators", "default_deferrable", fallback=False),
    **kwargs: Any,
)

Bases: BaseSensorOperator

Wait until a LaminDB branch reaches a status, e.g. until its Change Request is merged.

Returns the branch (with its status), which is pushed to XCom. Fails without retries if the branch reaches one of the failure_status statuses (by default, when the Change Request is closed without merging). Network errors, rate limiting and LaminHub server errors don't end the wait; the sensor checks again later.

For more information on how to use this sensor, take a look at the guide.

Parameters:

  • branch (str | int) –

    Branch name or id.

  • target_status (str | Sequence[str], default: 'merged' ) –

    Status (or statuses) to wait for, any of standalone, draft, review, merged and closed.

  • failure_status (str | Sequence[str], default: ('closed',) ) –

    Status (or statuses) that fail the sensor.

  • lamindb_conn_id (str | None, default: default_conn_name ) –

    Airflow connection of type lamindb.

  • instance (str | None, default: None ) –

    LaminDB instance owner/name; overrides the connection's instance.

  • deferrable (bool, default: getboolean('operators', 'default_deferrable', fallback=False) ) –

    Wait in the triggerer instead of occupying a worker slot.

Source code in src/airflow/providers/lamindb/sensors/branches.py
def __init__(
    self,
    *,
    branch: str | int,
    target_status: str | Sequence[str] = "merged",
    failure_status: str | Sequence[str] = ("closed",),
    lamindb_conn_id: str | None = LaminDBHook.default_conn_name,
    instance: str | None = None,
    deferrable: bool = conf.getboolean("operators", "default_deferrable", fallback=False),
    **kwargs: Any,
) -> None:
    super().__init__(**kwargs)
    self.branch = branch
    self.target_status = normalize_statuses(target_status, name="target_status") or []
    self.failure_status = normalize_statuses(failure_status, name="failure_status") or []
    if not self.target_status:
        raise ValueError("target_status must not be empty")
    if overlap := set(self.target_status) & set(self.failure_status):
        raise ValueError(f"Statuses {sorted(overlap)} are both target and failure statuses")
    self.lamindb_conn_id = lamindb_conn_id
    self.instance = instance
    self.deferrable = deferrable

airflow.providers.lamindb.sensors.records

LaminDBRecordSensor

LaminDBRecordSensor(
    *,
    registry: LaminDBRegistry | str,
    filter: FilterExpression | None = None,
    branch: str | int | None = "main",
    min_count: int = 1,
    limit: int = 100,
    wait_for_upload: bool | None = None,
    lamindb_conn_id: str | None = default_conn_name,
    instance: str | None = None,
    deferrable: bool = getboolean("operators", "default_deferrable", fallback=False),
    **kwargs: Any,
)

Bases: BaseSensorOperator

Wait until records matching a filter exist in a LaminDB registry.

Returns the matching records (newest first, at most limit), which are pushed to XCom. Network errors, rate limiting and LaminHub server errors don't end the wait; the sensor checks again later.

For more information on how to use this sensor, take a look at the guide.

Parameters:

  • registry (LaminDBRegistry | str) –

    Registry to query, e.g. LaminDBRegistry.RUN, "core.artifact" or "bionty.celltype".

  • filter (FilterExpression | None, default: None ) –

    Filter built with F, e.g. F(ArtifactField.KEY) == "raw/sample1.fastq.gz". It's validated when the DAG is parsed, and again with its templates rendered.

  • branch (str | int | None, default: 'main' ) –

    Only records on this branch (name or id); None for all branches and for registries without branches.

  • min_count (int, default: 1 ) –

    Number of matching records to wait for.

  • limit (int, default: 100 ) –

    Maximum number of records returned.

  • wait_for_upload (bool | None, default: None ) –

    Ignore artifacts whose upload to storage is still in progress.

  • lamindb_conn_id (str | None, default: default_conn_name ) –

    Airflow connection of type lamindb.

  • instance (str | None, default: None ) –

    LaminDB instance owner/name; overrides the connection's instance.

  • deferrable (bool, default: getboolean('operators', 'default_deferrable', fallback=False) ) –

    Wait in the triggerer instead of occupying a worker slot.

Source code in src/airflow/providers/lamindb/sensors/records.py
def __init__(
    self,
    *,
    registry: LaminDBRegistry | str,
    filter: FilterExpression | None = None,
    branch: str | int | None = "main",
    min_count: int = 1,
    limit: int = 100,
    wait_for_upload: bool | None = None,
    lamindb_conn_id: str | None = LaminDBHook.default_conn_name,
    instance: str | None = None,
    deferrable: bool = conf.getboolean("operators", "default_deferrable", fallback=False),
    **kwargs: Any,
) -> None:
    super().__init__(**kwargs)
    if min_count < 1 or limit < min_count:
        raise ValueError("min_count must be at least 1 and not larger than limit")
    self.registry: str = plain_value(registry)
    # the JSON form, so that Airflow renders templates in it and shows it as JSON
    self.filter = normalize_filter(filter)
    self.branch = branch
    self.min_count = min_count
    self.limit = limit
    self.wait_for_upload = wait_for_upload
    self.lamindb_conn_id = lamindb_conn_id
    self.instance = instance
    self.deferrable = deferrable

LaminDBArtifactSensor

LaminDBArtifactSensor(
    *,
    key: str | None = None,
    key_prefix: str | None = None,
    suffix: str | Sequence[str] | None = None,
    kind: str | Sequence[str] | None = None,
    include_internal: bool = False,
    wait_for_upload: bool = True,
    **kwargs: Any,
)

Bases: LaminDBRecordSensor

Wait until LaminDB artifacts matching some criteria exist and their upload has completed.

Returns the matching artifacts (newest first, at most limit), which are pushed to XCom.

For more information on how to use this sensor, take a look at the guide.

Parameters:

  • key (str | None, default: None ) –

    Artifact key, e.g. "raw/sample1.fastq.gz".

  • key_prefix (str | None, default: None ) –

    Key prefix, e.g. "raw/".

  • suffix (str | Sequence[str] | None, default: None ) –

    Suffix (or suffixes), e.g. ".parquet".

  • kind (str | Sequence[str] | None, default: None ) –

    Artifact kind (or kinds), e.g. ArtifactKind.DATASET.

  • include_internal (bool, default: False ) –

    Also consider artifacts LaminDB creates internally (run logs, ...).

  • filter –

    Additional filter, see LaminDBRecordSensor.

  • wait_for_upload (bool, default: True ) –

    Ignore artifacts whose upload is still in progress (default).

Source code in src/airflow/providers/lamindb/sensors/records.py
def __init__(
    self,
    *,
    key: str | None = None,
    key_prefix: str | None = None,
    suffix: str | Sequence[str] | None = None,
    kind: str | Sequence[str] | None = None,
    include_internal: bool = False,
    wait_for_upload: bool = True,
    **kwargs: Any,
) -> None:
    kwargs.pop("registry", None)
    super().__init__(registry="core.artifact", wait_for_upload=wait_for_upload, **kwargs)
    self.key = key
    self.key_prefix = key_prefix
    self.suffix = normalize_str_list(suffix)
    self.kind = normalize_str_list(kind)
    self.include_internal = include_internal

airflow.providers.lamindb.hooks.lamindb

LaminDBHook

LaminDBHook(
    lamindb_conn_id: str | None = default_conn_name,
    instance: str | None = None,
    *,
    timeout: float = 30.0,
    retries: int = 3,
    retry_backoff: float = 1.0,
    **kwargs: Any,
)

Bases: BaseHook

Interact with LaminDB instances hosted on LaminHub via the LaminHub REST API.

An Airflow wrapper around LaminHubClient: the hook reads the connection and delegates requests to one client. The connection's password is a Lamin API key; it is exchanged for a short-lived access token that is refreshed automatically. Without an API key, requests are anonymous, which works for public instances. The instance (owner/name) is read from the connection's instance extra and can be overridden per hook. Instances on lamindb older than 2.8.1 are rejected with LaminDBVersionError.

Parameters:

  • lamindb_conn_id (str | None, default: default_conn_name ) –

    Airflow connection of type lamindb. None means anonymous access with default settings, which requires instance to be passed.

  • instance (str | None, default: None ) –

    LaminDB instance slug owner/name. Overrides the connection's instance.

  • timeout (float, default: 30.0 ) –

    Timeout for HTTP requests in seconds.

  • retries (int, default: 3 ) –

    Number of retries for connection errors and retryable HTTP status codes (429 and 5xx).

  • retry_backoff (float, default: 1.0 ) –

    Base delay in seconds for the exponential retry backoff.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def __init__(
    self,
    lamindb_conn_id: str | None = default_conn_name,
    instance: str | None = None,
    *,
    timeout: float = 30.0,
    retries: int = 3,
    retry_backoff: float = 1.0,
    **kwargs: Any,
) -> None:
    super().__init__(**kwargs)
    self.lamindb_conn_id = lamindb_conn_id
    self.instance_slug = instance
    self.timeout = timeout
    self.retries = retries
    self.retry_backoff = retry_backoff
    self._config: LaminHubConfig | None = None
    self._lamindb_client: LaminHubClient | None = None

get_client

get_client() -> LaminHubClient

Return the (lazily created) LaminHub client for the connection.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def get_client(self) -> LaminHubClient:
    """Return the (lazily created) LaminHub client for the connection."""
    return self._lamindb_client or self._new_client(self._get_config())

aget_client async

aget_client() -> LaminHubClient

Async version of get_client: reads the connection without blocking the event loop.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
async def aget_client(self) -> LaminHubClient:
    """Async version of [`get_client`][]: reads the connection without blocking the event loop."""
    return self._lamindb_client or self._new_client(await self._aget_config())

get_conn

get_conn() -> LaminHubClient

Return the LaminHub client, as get_client.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def get_conn(self) -> LaminHubClient:
    """Return the LaminHub client, as [`get_client`][]."""
    return self.get_client()

close

close() -> None

Close the client's synchronous HTTP connections.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def close(self) -> None:
    """Close the client's synchronous HTTP connections."""
    if self._lamindb_client is not None:
        self._lamindb_client.close()

aclose async

aclose() -> None

Close the client's asynchronous HTTP connections.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
async def aclose(self) -> None:
    """Close the client's asynchronous HTTP connections."""
    if self._lamindb_client is not None:
        await self._lamindb_client.aclose()

get_instance_slug

get_instance_slug() -> str

Return the configured instance owner/name without contacting LaminHub.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def get_instance_slug(self) -> str:
    """Return the configured instance ``owner/name`` without contacting LaminHub."""
    config = self._get_config()
    return f"{config.owner}/{config.name}"

get_api_key

get_api_key() -> str | None

Return the connection's Lamin API key, or None for anonymous access.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def get_api_key(self) -> str | None:
    """Return the connection's Lamin API key, or ``None`` for anonymous access."""
    return self._get_config().api_key

get_cache_dir

get_cache_dir() -> str | None

Return the connection's cache_dir extra: the lamindb cache shared by virtualenv tasks.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def get_cache_dir(self) -> str | None:
    """Return the connection's ``cache_dir`` extra: the lamindb cache shared by virtualenv tasks."""
    return self._get_config().cache_dir

get_instance

get_instance() -> LaminDBInstance

Return the configured instance (resolves its id and regional API URL on first use).

Raises LaminDBVersionError if the instance runs lamindb older than 2.8.1.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def get_instance(self) -> LaminDBInstance:
    """
    Return the configured instance (resolves its id and regional API URL on first use).

    Raises [`LaminDBVersionError`][airflow.providers.lamindb.exceptions.LaminDBVersionError] if the
    instance runs lamindb older than 2.8.1.
    """
    return self.get_client().get_instance()

get_schema

get_schema() -> InstanceSchemaResponse

Return the instance schema; schema.root maps {module: {model: RegistrySchemaResponse}}.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def get_schema(self) -> InstanceSchemaResponse:
    """Return the instance schema; ``schema.root`` maps ``{module: {model: RegistrySchemaResponse}}``."""
    return self.get_client().get_schema()

get_registry

get_registry(registry: LaminDBRegistry | Registry | str) -> Registry

Resolve a registry name such as core.artifact or bionty.gene.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def get_registry(self, registry: LaminDBRegistry | Registry | str) -> Registry:
    """Resolve a registry name such as ``core.artifact`` or ``bionty.gene``."""
    return self.get_client().get_registry(registry)

query_records

query_records(
    registry: LaminDBRegistry | Registry | str,
    filter: FilterExpression | None = None,
    *,
    select: Sequence[str] | None = None,
    order_by: Sequence[str | RecordOrder] | None = None,
    limit: int = 50,
    offset: int = 0,
    include_foreign_keys: bool = True,
    search: str | None = None,
    branch_ids: Sequence[int] | None = None,
) -> list[dict[str, Any]]

Query records of a registry.

Parameters:

  • registry (LaminDBRegistry | Registry | str) –

    Registry name such as core.artifact, core.run or bionty.gene, or a LaminDBRegistry member.

  • filter (FilterExpression | None, default: None ) –

    Filter built with F, e.g. F(ArtifactField.SUFFIX) == ".csv", or a LaminHub REST filter such as {"suffix": {"eq": ".csv"}}, see https://docs.lamin.ai/rest

  • select (Sequence[str] | None, default: None ) –

    Fields (and relations such as created_by(handle)) to return.

  • order_by (Sequence[str | RecordOrder] | None, default: None ) –

    Sort order, for example ["-created_at"] or [RecordOrder(field="created_at", descending=True)]. Defaults to ascending id.

  • limit (int, default: 50 ) –

    Maximum number of records; requests are paginated in pages of 200.

  • offset (int, default: 0 ) –

    Number of records to skip.

  • include_foreign_keys (bool, default: True ) –

    Include foreign key columns (run_id, branch_id, ...).

  • search (str | None, default: None ) –

    Full-text search string.

  • branch_ids (Sequence[int] | None, default: None ) –

    Restrict the query scope to these branch ids.

    Invalid request fields raise pydantic.ValidationError before HTTP requests are made. limit and offset must be non-negative integers.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def query_records(
    self,
    registry: LaminDBRegistry | Registry | str,
    filter: FilterExpression | None = None,
    *,
    select: Sequence[str] | None = None,
    order_by: Sequence[str | RecordOrder] | None = None,
    limit: int = 50,
    offset: int = 0,
    include_foreign_keys: bool = True,
    search: str | None = None,
    branch_ids: Sequence[int] | None = None,
) -> list[dict[str, Any]]:
    """
    Query records of a registry.

    :param registry: Registry name such as ``core.artifact``, ``core.run`` or ``bionty.gene``,
        or a [`LaminDBRegistry`][airflow.providers.lamindb.client.enums.LaminDBRegistry] member.
    :param filter: Filter built with [`F`][airflow.providers.lamindb.client.filters.F], e.g.
        ``F(ArtifactField.SUFFIX) == ".csv"``, or a LaminHub REST filter such as
        ``{"suffix": {"eq": ".csv"}}``, see https://docs.lamin.ai/rest
    :param select: Fields (and relations such as ``created_by(handle)``) to return.
    :param order_by: Sort order, for example ``["-created_at"]`` or
        ``[RecordOrder(field="created_at", descending=True)]``. Defaults to ascending ``id``.
    :param limit: Maximum number of records; requests are paginated in pages of 200.
    :param offset: Number of records to skip.
    :param include_foreign_keys: Include foreign key columns (``run_id``, ``branch_id``, ...).
    :param search: Full-text search string.
    :param branch_ids: Restrict the query scope to these branch ids.

    Invalid request fields raise ``pydantic.ValidationError`` before HTTP requests are made.
    ``limit`` and ``offset`` must be non-negative integers.
    """
    return self.get_client().query_records(
        registry,
        filter,
        select=select,
        order_by=order_by,
        limit=limit,
        offset=offset,
        include_foreign_keys=include_foreign_keys,
        search=search,
        branch_ids=branch_ids,
    )

get_records_by_ids

get_records_by_ids(
    registry: LaminDBRegistry | Registry | str,
    ids: Iterable[int],
    filter: FilterExpression | None = None,
) -> dict[int, dict[str, Any]]

Fetch records by id, optionally restricted by an additional filter. Returns {id: record}.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def get_records_by_ids(
    self,
    registry: LaminDBRegistry | Registry | str,
    ids: Iterable[int],
    filter: FilterExpression | None = None,
) -> dict[int, dict[str, Any]]:
    """Fetch records by id, optionally restricted by an additional filter. Returns ``{id: record}``."""
    return self.get_client().get_records_by_ids(registry, ids, filter)

query_dbwrites

query_dbwrites(
    filter: FilterExpression | None = None,
    *,
    after_id: int | None = None,
    limit: int = MAX_PAGE_SIZE,
    descending: bool = False,
) -> list[dict[str, Any]]

Query the LaminHub database write log, ordered by id.

Every INSERT, UPDATE and DELETE on the instance database is logged with table_name, sqlrecord_id, event_type, branch_id and data. For updates, data holds the previous values of the changed fields; for deletes the full previous row; for inserts it is null.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def query_dbwrites(
    self,
    filter: FilterExpression | None = None,
    *,
    after_id: int | None = None,
    limit: int = MAX_PAGE_SIZE,
    descending: bool = False,
) -> list[dict[str, Any]]:
    """
    Query the LaminHub database write log, ordered by id.

    Every ``INSERT``, ``UPDATE`` and ``DELETE`` on the instance database is logged with
    ``table_name``, ``sqlrecord_id``, ``event_type``, ``branch_id`` and ``data``. For updates,
    ``data`` holds the *previous* values of the changed fields; for deletes the full previous
    row; for inserts it is ``null``.
    """
    return self.get_client().query_dbwrites(filter, after_id=after_id, limit=limit, descending=descending)

get_latest_dbwrite_id

get_latest_dbwrite_id() -> int

Return the id of the most recent database write (0 if there is none).

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def get_latest_dbwrite_id(self) -> int:
    """Return the id of the most recent database write (``0`` if there is none)."""
    return self.get_client().get_latest_dbwrite_id()

get_branch

get_branch(branch: str | int) -> BranchRecordResponse | None

Return a branch record by name or id, or None if it doesn't exist.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def get_branch(self, branch: str | int) -> BranchRecordResponse | None:
    """Return a branch record by name or id, or ``None`` if it doesn't exist."""
    return self.get_client().get_branch(branch)

get_users

get_users(ids: Iterable[int]) -> dict[int, UserRecordResponse]

Return {id: user} for the given user ids.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def get_users(self, ids: Iterable[int]) -> dict[int, UserRecordResponse]:
    """Return ``{id: user}`` for the given user ids."""
    return self.get_client().get_users(ids)

insert_records

insert_records(
    registry: LaminDBRegistry | Registry | str, records: Sequence[Mapping[str, Any]]
) -> list[dict[str, Any]]

Insert records into a registry and return the created rows.

Needs write access to the instance. Fields are column names, e.g. {"name": "treated"} or {"type_id": 3}. Inserts are not retried after errors that may have reached LaminHub, so a failed request never creates a record twice.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def insert_records(
    self, registry: LaminDBRegistry | Registry | str, records: Sequence[Mapping[str, Any]]
) -> list[dict[str, Any]]:
    """
    Insert records into a registry and return the created rows.

    Needs write access to the instance. Fields are column names, e.g. ``{"name": "treated"}`` or
    ``{"type_id": 3}``. Inserts are not retried after errors that may have reached LaminHub, so a
    failed request never creates a record twice.
    """
    return self.get_client().insert_records(registry, records)

update_record

update_record(
    registry: LaminDBRegistry | Registry | str, uid: str, values: Mapping[str, Any]
) -> dict[str, Any] | None

Update fields of the record with uid and return the updated row (if LaminHub returns it).

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def update_record(
    self, registry: LaminDBRegistry | Registry | str, uid: str, values: Mapping[str, Any]
) -> dict[str, Any] | None:
    """Update fields of the record with ``uid`` and return the updated row (if LaminHub returns it)."""
    return self.get_client().update_record(registry, uid, values)

test_connection

test_connection() -> tuple[bool, str]

Test the connection by resolving the instance and reading its database write log.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
def test_connection(self) -> tuple[bool, str]:
    """Test the connection by resolving the instance and reading its database write log."""
    try:
        instance = self.get_instance()
        self.query_dbwrites(limit=1, descending=True)
    except Exception as err:
        return False, str(err)
    finally:
        self.close()
    return True, f"Connected to LaminDB instance {instance.slug} ({instance.api_url})."

aget_instance async

aget_instance() -> LaminDBInstance

Async version of get_instance.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
async def aget_instance(self) -> LaminDBInstance:
    """Async version of [`get_instance`][]."""
    return await (await self.aget_client()).aget_instance()

aget_schema async

aget_schema() -> InstanceSchemaResponse

Async version of get_schema.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
async def aget_schema(self) -> InstanceSchemaResponse:
    """Async version of [`get_schema`][]."""
    return await (await self.aget_client()).aget_schema()

aget_registry async

aget_registry(registry: LaminDBRegistry | Registry | str) -> Registry

Async version of get_registry.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
async def aget_registry(self, registry: LaminDBRegistry | Registry | str) -> Registry:
    """Async version of [`get_registry`][]."""
    return await (await self.aget_client()).aget_registry(registry)

aquery_records async

aquery_records(
    registry: LaminDBRegistry | Registry | str,
    filter: FilterExpression | None = None,
    *,
    select: Sequence[str] | None = None,
    order_by: Sequence[str | RecordOrder] | None = None,
    limit: int = 50,
    offset: int = 0,
    include_foreign_keys: bool = True,
    search: str | None = None,
    branch_ids: Sequence[int] | None = None,
) -> list[dict[str, Any]]

Async version of query_records.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
async def aquery_records(
    self,
    registry: LaminDBRegistry | Registry | str,
    filter: FilterExpression | None = None,
    *,
    select: Sequence[str] | None = None,
    order_by: Sequence[str | RecordOrder] | None = None,
    limit: int = 50,
    offset: int = 0,
    include_foreign_keys: bool = True,
    search: str | None = None,
    branch_ids: Sequence[int] | None = None,
) -> list[dict[str, Any]]:
    """Async version of [`query_records`][]."""
    return await (await self.aget_client()).aquery_records(
        registry,
        filter,
        select=select,
        order_by=order_by,
        limit=limit,
        offset=offset,
        include_foreign_keys=include_foreign_keys,
        search=search,
        branch_ids=branch_ids,
    )

aget_records_by_ids async

aget_records_by_ids(
    registry: LaminDBRegistry | Registry | str,
    ids: Iterable[int],
    filter: FilterExpression | None = None,
) -> dict[int, dict[str, Any]]

Async version of get_records_by_ids.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
async def aget_records_by_ids(
    self,
    registry: LaminDBRegistry | Registry | str,
    ids: Iterable[int],
    filter: FilterExpression | None = None,
) -> dict[int, dict[str, Any]]:
    """Async version of [`get_records_by_ids`][]."""
    return await (await self.aget_client()).aget_records_by_ids(registry, ids, filter)

aquery_dbwrites async

aquery_dbwrites(
    filter: FilterExpression | None = None,
    *,
    after_id: int | None = None,
    limit: int = MAX_PAGE_SIZE,
    descending: bool = False,
) -> list[dict[str, Any]]

Async version of query_dbwrites.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
async def aquery_dbwrites(
    self,
    filter: FilterExpression | None = None,
    *,
    after_id: int | None = None,
    limit: int = MAX_PAGE_SIZE,
    descending: bool = False,
) -> list[dict[str, Any]]:
    """Async version of [`query_dbwrites`][]."""
    return await (await self.aget_client()).aquery_dbwrites(
        filter, after_id=after_id, limit=limit, descending=descending
    )

aget_latest_dbwrite_id async

aget_latest_dbwrite_id() -> int

Async version of get_latest_dbwrite_id.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
async def aget_latest_dbwrite_id(self) -> int:
    """Async version of [`get_latest_dbwrite_id`][]."""
    return await (await self.aget_client()).aget_latest_dbwrite_id()

aget_branch async

aget_branch(branch: str | int) -> BranchRecordResponse | None

Async version of get_branch.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
async def aget_branch(self, branch: str | int) -> BranchRecordResponse | None:
    """Async version of [`get_branch`][]."""
    return await (await self.aget_client()).aget_branch(branch)

aget_users async

aget_users(ids: Iterable[int]) -> dict[int, UserRecordResponse]

Async version of get_users.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
async def aget_users(self, ids: Iterable[int]) -> dict[int, UserRecordResponse]:
    """Async version of [`get_users`][]."""
    return await (await self.aget_client()).aget_users(ids)

ainsert_records async

ainsert_records(
    registry: LaminDBRegistry | Registry | str, records: Sequence[Mapping[str, Any]]
) -> list[dict[str, Any]]

Async version of insert_records.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
async def ainsert_records(
    self, registry: LaminDBRegistry | Registry | str, records: Sequence[Mapping[str, Any]]
) -> list[dict[str, Any]]:
    """Async version of [`insert_records`][]."""
    return await (await self.aget_client()).ainsert_records(registry, records)

aupdate_record async

aupdate_record(
    registry: LaminDBRegistry | Registry | str, uid: str, values: Mapping[str, Any]
) -> dict[str, Any] | None

Async version of update_record.

Source code in src/airflow/providers/lamindb/hooks/lamindb.py
async def aupdate_record(
    self, registry: LaminDBRegistry | Registry | str, uid: str, values: Mapping[str, Any]
) -> dict[str, Any] | None:
    """Async version of [`update_record`][]."""
    return await (await self.aget_client()).aupdate_record(registry, uid, values)

airflow.providers.lamindb.client.client

Client for the LaminHub REST API.

DEFAULT_HUB_API_URL module-attribute

DEFAULT_HUB_API_URL = 'https://aws.us-east-1.lamin.ai/api'

MAX_PAGE_SIZE module-attribute

MAX_PAGE_SIZE = 200

Maximum number of records the LaminHub REST API returns per request.

LaminHubClient

LaminHubClient(
    config: LaminHubConfig,
    *,
    timeout: float = 30.0,
    retries: int = 3,
    retry_backoff: float = 1.0,
)

Synchronous and asynchronous client for the LaminHub REST API of one LaminDB instance.

The API key of config is exchanged for a short-lived access token that is refreshed automatically; without one, requests are anonymous, which works for public instances. The instance, its schema and the access token are cached and shared by the sync and async methods. Instances on lamindb older than 2.8.1 are rejected with LaminDBVersionError.

Parameters:

  • config (LaminHubConfig) –

    LaminHub URL, API key and instance.

  • timeout (float, default: 30.0 ) –

    Timeout for HTTP requests in seconds.

  • retries (int, default: 3 ) –

    Number of retries for connection errors and retryable HTTP status codes (429 and 5xx).

  • retry_backoff (float, default: 1.0 ) –

    Base delay in seconds for the exponential retry backoff.

Source code in src/airflow/providers/lamindb/client/client.py
def __init__(
    self,
    config: LaminHubConfig,
    *,
    timeout: float = 30.0,
    retries: int = 3,
    retry_backoff: float = 1.0,
) -> None:
    self.config = config
    self.timeout = timeout
    self.retries = retries
    self.retry_backoff = retry_backoff
    self._access_token: str | None = None
    self._access_token_expiry = 0.0
    self._instance: LaminDBInstance | None = None
    self._schema: InstanceSchemaResponse | None = None
    self._client: httpx.Client | None = None
    self._async_client: httpx.AsyncClient | None = None

get_instance

get_instance() -> LaminDBInstance

Return the configured instance (resolves its id and regional API URL on first use).

Raises LaminDBVersionError if the instance runs lamindb older than 2.8.1.

Source code in src/airflow/providers/lamindb/client/client.py
def get_instance(self) -> LaminDBInstance:
    """
    Return the configured instance (resolves its id and regional API URL on first use).

    Raises [`LaminDBVersionError`][airflow.providers.lamindb.exceptions.LaminDBVersionError] if the
    instance runs lamindb older than 2.8.1.
    """
    if self._instance is None:
        config = self.config
        settings = self._send("GET", self._settings_url(config))
        self._instance = self._instance_from_settings(config, settings)
    return self._instance

get_schema

get_schema() -> InstanceSchemaResponse

Return the instance schema; schema.root maps {module: {model: RegistrySchemaResponse}}.

Source code in src/airflow/providers/lamindb/client/client.py
def get_schema(self) -> InstanceSchemaResponse:
    """Return the instance schema; ``schema.root`` maps ``{module: {model: RegistrySchemaResponse}}``."""
    if self._schema is None:
        instance = self.get_instance()
        self._schema = self._check_schema(
            self._send("GET", f"{instance.api_url}/instances/{instance.id}/schema")
        )
    return self._schema

get_registry

get_registry(registry: LaminDBRegistry | Registry | str) -> Registry

Resolve a registry name such as core.artifact or bionty.gene.

Source code in src/airflow/providers/lamindb/client/client.py
def get_registry(self, registry: LaminDBRegistry | Registry | str) -> Registry:
    """Resolve a registry name such as ``core.artifact`` or ``bionty.gene``."""
    if isinstance(registry, Registry):
        return registry
    if registry.lower().startswith("hubmodule."):
        return resolve_registry(_NO_SCHEMA, registry)
    return resolve_registry(self.get_schema(), registry)

query_records

query_records(
    registry: LaminDBRegistry | Registry | str,
    filter: FilterExpression | None = None,
    *,
    select: Sequence[str] | None = None,
    order_by: Sequence[str | RecordOrder] | None = None,
    limit: int = 50,
    offset: int = 0,
    include_foreign_keys: bool = True,
    search: str | None = None,
    branch_ids: Sequence[int] | None = None,
) -> list[dict[str, Any]]

Query records of a registry.

Parameters:

  • registry (LaminDBRegistry | Registry | str) –

    Registry name such as core.artifact, core.run or bionty.gene, or a LaminDBRegistry member.

  • filter (FilterExpression | None, default: None ) –

    Filter built with F, e.g. F(ArtifactField.SUFFIX) == ".csv". Convert a LaminHub REST filter dict (https://docs.lamin.ai/rest) with FilterExpression.from_dict.

  • select (Sequence[str] | None, default: None ) –

    Fields (and relations such as created_by(handle)) to return.

  • order_by (Sequence[str | RecordOrder] | None, default: None ) –

    Sort order, for example ["-created_at"] or [RecordOrder(field="created_at", descending=True)]. Defaults to ascending id.

  • limit (int, default: 50 ) –

    Maximum number of records; requests are paginated in pages of 200.

  • offset (int, default: 0 ) –

    Number of records to skip.

  • include_foreign_keys (bool, default: True ) –

    Include foreign key columns (run_id, branch_id, ...).

  • search (str | None, default: None ) –

    Full-text search string.

  • branch_ids (Sequence[int] | None, default: None ) –

    Restrict the query scope to these branch ids.

    Invalid request fields raise pydantic.ValidationError before HTTP requests are made. limit and offset must be non-negative integers.

Source code in src/airflow/providers/lamindb/client/client.py
def query_records(
    self,
    registry: LaminDBRegistry | Registry | str,
    filter: FilterExpression | None = None,
    *,
    select: Sequence[str] | None = None,
    order_by: Sequence[str | RecordOrder] | None = None,
    limit: int = 50,
    offset: int = 0,
    include_foreign_keys: bool = True,
    search: str | None = None,
    branch_ids: Sequence[int] | None = None,
) -> list[dict[str, Any]]:
    """
    Query records of a registry.

    :param registry: Registry name such as ``core.artifact``, ``core.run`` or ``bionty.gene``,
        or a [`LaminDBRegistry`][airflow.providers.lamindb.client.enums.LaminDBRegistry] member.
    :param filter: Filter built with [`F`][airflow.providers.lamindb.client.filters.F], e.g.
        ``F(ArtifactField.SUFFIX) == ".csv"``. Convert a LaminHub REST filter dict
        (https://docs.lamin.ai/rest) with
        [`FilterExpression.from_dict`][airflow.providers.lamindb.client.filters.FilterExpression.from_dict].
    :param select: Fields (and relations such as ``created_by(handle)``) to return.
    :param order_by: Sort order, for example ``["-created_at"]`` or
        ``[RecordOrder(field="created_at", descending=True)]``. Defaults to ascending ``id``.
    :param limit: Maximum number of records; requests are paginated in pages of 200.
    :param offset: Number of records to skip.
    :param include_foreign_keys: Include foreign key columns (``run_id``, ``branch_id``, ...).
    :param search: Full-text search string.
    :param branch_ids: Restrict the query scope to these branch ids.

    Invalid request fields raise ``pydantic.ValidationError`` before HTTP requests are made.
    ``limit`` and ``offset`` must be non-negative integers.
    """
    query_params, query_body = self._query_request(
        filter=filter,
        select=select,
        order_by=order_by,
        limit=limit,
        offset=offset,
        include_foreign_keys=include_foreign_keys,
        search=search,
        branch_ids=branch_ids,
    )
    reg = self.get_registry(registry)
    instance = self.get_instance()
    url = _registry_url(instance, reg)
    body = query_body.model_dump(mode="json", exclude_none=True)
    results: list[dict[str, Any]] = []
    while len(results) < limit:
        page_size = min(MAX_PAGE_SIZE, limit - len(results))
        params = query_params.model_copy(
            update={"limit": page_size, "offset": offset + len(results)}
        ).model_dump()
        page = self._check_page(self._send("POST", url, params=params, json=body), reg)
        results.extend(page)
        if len(page) < page_size:
            break
    return results

get_records_by_ids

get_records_by_ids(
    registry: LaminDBRegistry | Registry | str,
    ids: Iterable[int],
    filter: FilterExpression | None = None,
) -> dict[int, dict[str, Any]]

Fetch records by id, optionally restricted by an additional filter. Returns {id: record}.

Source code in src/airflow/providers/lamindb/client/client.py
def get_records_by_ids(
    self,
    registry: LaminDBRegistry | Registry | str,
    ids: Iterable[int],
    filter: FilterExpression | None = None,
) -> dict[int, dict[str, Any]]:
    """Fetch records by id, optionally restricted by an additional filter. Returns ``{id: record}``."""
    records: dict[int, dict[str, Any]] = {}
    for chunk in chunk_ids(ids):
        combined = combine_filters(F("id").is_in(chunk), filter)
        for record in self.query_records(registry, combined, limit=len(chunk)):
            records[record["id"]] = record
    return records

query_dbwrites

query_dbwrites(
    filter: FilterExpression | None = None,
    *,
    after_id: int | None = None,
    limit: int = MAX_PAGE_SIZE,
    descending: bool = False,
) -> list[dict[str, Any]]

Query the LaminHub database write log, ordered by id.

Every INSERT, UPDATE and DELETE on the instance database is logged with table_name, sqlrecord_id, event_type, branch_id and data. For updates, data holds the previous values of the changed fields; for deletes the full previous row; for inserts it is null.

Source code in src/airflow/providers/lamindb/client/client.py
def query_dbwrites(
    self,
    filter: FilterExpression | None = None,
    *,
    after_id: int | None = None,
    limit: int = MAX_PAGE_SIZE,
    descending: bool = False,
) -> list[dict[str, Any]]:
    """
    Query the LaminHub database write log, ordered by id.

    Every ``INSERT``, ``UPDATE`` and ``DELETE`` on the instance database is logged with
    ``table_name``, ``sqlrecord_id``, ``event_type``, ``branch_id`` and ``data``. For updates,
    ``data`` holds the *previous* values of the changed fields; for deletes the full previous
    row; for inserts it is ``null``.
    """
    return self.query_records(
        DBWRITE_REGISTRY,
        self._dbwrite_filter(filter, after_id),
        order_by=[RecordOrder(field="id", descending=descending)],
        limit=limit,
    )

get_latest_dbwrite_id

get_latest_dbwrite_id() -> int

Return the id of the most recent database write (0 if there is none).

Source code in src/airflow/providers/lamindb/client/client.py
def get_latest_dbwrite_id(self) -> int:
    """Return the id of the most recent database write (``0`` if there is none)."""
    rows = self.query_dbwrites(limit=1, descending=True)
    return int(rows[0]["id"]) if rows else 0

get_branch

get_branch(branch: str | int) -> BranchRecordResponse | None

Return a branch record by name or id, or None if it doesn't exist.

Source code in src/airflow/providers/lamindb/client/client.py
def get_branch(self, branch: str | int) -> BranchRecordResponse | None:
    """Return a branch record by name or id, or ``None`` if it doesn't exist."""
    rows = self.query_records("core.branch", self._branch_filter(branch), limit=1)
    return BranchRecordResponse.model_validate(rows[0]) if rows else None

get_users

get_users(ids: Iterable[int]) -> dict[int, UserRecordResponse]

Return {id: user} for the given user ids.

Source code in src/airflow/providers/lamindb/client/client.py
def get_users(self, ids: Iterable[int]) -> dict[int, UserRecordResponse]:
    """Return ``{id: user}`` for the given user ids."""
    return _users(self.get_records_by_ids("core.user", ids))

insert_records

insert_records(
    registry: LaminDBRegistry | Registry | str, records: Sequence[Mapping[str, Any]]
) -> list[dict[str, Any]]

Insert records into a registry and return the created rows.

Needs write access to the instance. Fields are column names, e.g. {"name": "treated"} or {"type_id": 3}. Inserts are not retried after errors that may have reached LaminHub, so a failed request never creates a record twice.

Source code in src/airflow/providers/lamindb/client/client.py
def insert_records(
    self, registry: LaminDBRegistry | Registry | str, records: Sequence[Mapping[str, Any]]
) -> list[dict[str, Any]]:
    """
    Insert records into a registry and return the created rows.

    Needs write access to the instance. Fields are column names, e.g. ``{"name": "treated"}`` or
    ``{"type_id": 3}``. Inserts are not retried after errors that may have reached LaminHub, so a
    failed request never creates a record twice.
    """
    body = RecordInsertBody.model_validate(list(records)).model_dump(mode="json")
    reg = self.get_registry(registry)
    url = _registry_url(self.get_instance(), reg)
    return _written_rows(self._send("PUT", url, json=body, idempotent=False), reg)

update_record

update_record(
    registry: LaminDBRegistry | Registry | str, uid: str, values: Mapping[str, Any]
) -> dict[str, Any] | None

Update fields of the record with uid and return the updated row (if LaminHub returns it).

Source code in src/airflow/providers/lamindb/client/client.py
def update_record(
    self, registry: LaminDBRegistry | Registry | str, uid: str, values: Mapping[str, Any]
) -> dict[str, Any] | None:
    """Update fields of the record with ``uid`` and return the updated row (if LaminHub returns it)."""
    body = RecordUpdateBody.model_validate(dict(values)).model_dump(mode="json")
    reg = self.get_registry(registry)
    url = f"{_registry_url(self.get_instance(), reg)}/{uid}"
    rows = _written_rows(self._send("PATCH", url, json=body), reg)
    return rows[0] if rows else None

aget_instance async

aget_instance() -> LaminDBInstance

Async version of get_instance.

Source code in src/airflow/providers/lamindb/client/client.py
async def aget_instance(self) -> LaminDBInstance:
    """Async version of [`get_instance`][]."""
    if self._instance is None:
        config = self.config
        settings = await self._asend("GET", self._settings_url(config))
        self._instance = self._instance_from_settings(config, settings)
    return self._instance

aget_schema async

aget_schema() -> InstanceSchemaResponse

Async version of get_schema.

Source code in src/airflow/providers/lamindb/client/client.py
async def aget_schema(self) -> InstanceSchemaResponse:
    """Async version of [`get_schema`][]."""
    if self._schema is None:
        instance = await self.aget_instance()
        self._schema = self._check_schema(
            await self._asend("GET", f"{instance.api_url}/instances/{instance.id}/schema")
        )
    return self._schema

aget_registry async

aget_registry(registry: LaminDBRegistry | Registry | str) -> Registry

Async version of get_registry.

Source code in src/airflow/providers/lamindb/client/client.py
async def aget_registry(self, registry: LaminDBRegistry | Registry | str) -> Registry:
    """Async version of [`get_registry`][]."""
    if isinstance(registry, Registry):
        return registry
    if registry.lower().startswith("hubmodule."):
        return resolve_registry(_NO_SCHEMA, registry)
    return resolve_registry(await self.aget_schema(), registry)

aquery_records async

aquery_records(
    registry: LaminDBRegistry | Registry | str,
    filter: FilterExpression | None = None,
    *,
    select: Sequence[str] | None = None,
    order_by: Sequence[str | RecordOrder] | None = None,
    limit: int = 50,
    offset: int = 0,
    include_foreign_keys: bool = True,
    search: str | None = None,
    branch_ids: Sequence[int] | None = None,
) -> list[dict[str, Any]]

Async version of query_records.

Source code in src/airflow/providers/lamindb/client/client.py
async def aquery_records(
    self,
    registry: LaminDBRegistry | Registry | str,
    filter: FilterExpression | None = None,
    *,
    select: Sequence[str] | None = None,
    order_by: Sequence[str | RecordOrder] | None = None,
    limit: int = 50,
    offset: int = 0,
    include_foreign_keys: bool = True,
    search: str | None = None,
    branch_ids: Sequence[int] | None = None,
) -> list[dict[str, Any]]:
    """Async version of [`query_records`][]."""
    query_params, query_body = self._query_request(
        filter=filter,
        select=select,
        order_by=order_by,
        limit=limit,
        offset=offset,
        include_foreign_keys=include_foreign_keys,
        search=search,
        branch_ids=branch_ids,
    )
    reg = await self.aget_registry(registry)
    instance = await self.aget_instance()
    url = _registry_url(instance, reg)
    body = query_body.model_dump(mode="json", exclude_none=True)
    results: list[dict[str, Any]] = []
    while len(results) < limit:
        page_size = min(MAX_PAGE_SIZE, limit - len(results))
        params = query_params.model_copy(
            update={"limit": page_size, "offset": offset + len(results)}
        ).model_dump()
        page = self._check_page(await self._asend("POST", url, params=params, json=body), reg)
        results.extend(page)
        if len(page) < page_size:
            break
    return results

aget_records_by_ids async

aget_records_by_ids(
    registry: LaminDBRegistry | Registry | str,
    ids: Iterable[int],
    filter: FilterExpression | None = None,
) -> dict[int, dict[str, Any]]

Async version of get_records_by_ids.

Source code in src/airflow/providers/lamindb/client/client.py
async def aget_records_by_ids(
    self,
    registry: LaminDBRegistry | Registry | str,
    ids: Iterable[int],
    filter: FilterExpression | None = None,
) -> dict[int, dict[str, Any]]:
    """Async version of [`get_records_by_ids`][]."""
    records: dict[int, dict[str, Any]] = {}
    for chunk in chunk_ids(ids):
        combined = combine_filters(F("id").is_in(chunk), filter)
        for record in await self.aquery_records(registry, combined, limit=len(chunk)):
            records[record["id"]] = record
    return records

aquery_dbwrites async

aquery_dbwrites(
    filter: FilterExpression | None = None,
    *,
    after_id: int | None = None,
    limit: int = MAX_PAGE_SIZE,
    descending: bool = False,
) -> list[dict[str, Any]]

Async version of query_dbwrites.

Source code in src/airflow/providers/lamindb/client/client.py
async def aquery_dbwrites(
    self,
    filter: FilterExpression | None = None,
    *,
    after_id: int | None = None,
    limit: int = MAX_PAGE_SIZE,
    descending: bool = False,
) -> list[dict[str, Any]]:
    """Async version of [`query_dbwrites`][]."""
    return await self.aquery_records(
        DBWRITE_REGISTRY,
        self._dbwrite_filter(filter, after_id),
        order_by=[RecordOrder(field="id", descending=descending)],
        limit=limit,
    )

aget_latest_dbwrite_id async

aget_latest_dbwrite_id() -> int

Async version of get_latest_dbwrite_id.

Source code in src/airflow/providers/lamindb/client/client.py
async def aget_latest_dbwrite_id(self) -> int:
    """Async version of [`get_latest_dbwrite_id`][]."""
    rows = await self.aquery_dbwrites(limit=1, descending=True)
    return int(rows[0]["id"]) if rows else 0

aget_branch async

aget_branch(branch: str | int) -> BranchRecordResponse | None

Async version of get_branch.

Source code in src/airflow/providers/lamindb/client/client.py
async def aget_branch(self, branch: str | int) -> BranchRecordResponse | None:
    """Async version of [`get_branch`][]."""
    rows = await self.aquery_records("core.branch", self._branch_filter(branch), limit=1)
    return BranchRecordResponse.model_validate(rows[0]) if rows else None

aget_users async

aget_users(ids: Iterable[int]) -> dict[int, UserRecordResponse]

Async version of get_users.

Source code in src/airflow/providers/lamindb/client/client.py
async def aget_users(self, ids: Iterable[int]) -> dict[int, UserRecordResponse]:
    """Async version of [`get_users`][]."""
    return _users(await self.aget_records_by_ids("core.user", ids))

ainsert_records async

ainsert_records(
    registry: LaminDBRegistry | Registry | str, records: Sequence[Mapping[str, Any]]
) -> list[dict[str, Any]]

Async version of insert_records.

Source code in src/airflow/providers/lamindb/client/client.py
async def ainsert_records(
    self, registry: LaminDBRegistry | Registry | str, records: Sequence[Mapping[str, Any]]
) -> list[dict[str, Any]]:
    """Async version of [`insert_records`][]."""
    body = RecordInsertBody.model_validate(list(records)).model_dump(mode="json")
    reg = await self.aget_registry(registry)
    url = _registry_url(await self.aget_instance(), reg)
    return _written_rows(await self._asend("PUT", url, json=body, idempotent=False), reg)

aupdate_record async

aupdate_record(
    registry: LaminDBRegistry | Registry | str, uid: str, values: Mapping[str, Any]
) -> dict[str, Any] | None

Async version of update_record.

Source code in src/airflow/providers/lamindb/client/client.py
async def aupdate_record(
    self, registry: LaminDBRegistry | Registry | str, uid: str, values: Mapping[str, Any]
) -> dict[str, Any] | None:
    """Async version of [`update_record`][]."""
    body = RecordUpdateBody.model_validate(dict(values)).model_dump(mode="json")
    reg = await self.aget_registry(registry)
    url = f"{_registry_url(await self.aget_instance(), reg)}/{uid}"
    rows = _written_rows(await self._asend("PATCH", url, json=body), reg)
    return rows[0] if rows else None

LaminHubConfig dataclass

LaminHubConfig(
    hub_api_url: str,
    api_key: str | None,
    owner: str,
    name: str,
    cache_dir: str | None = None,
)

Where a LaminHubClient connects: the LaminHub API, the API key and the instance.

LaminDBInstance dataclass

LaminDBInstance(
    owner: str,
    name: str,
    id: str,
    api_url: str,
    lnid: str | None = None,
    schema_str: str | None = None,
    public: bool | None = None,
    lamindb_version: str | None = None,
)

A LaminDB instance registered on LaminHub.

airflow.providers.lamindb.client.registries

LaminDB registries (Django models) and how they are addressed in the LaminHub REST API.

DBWRITE_REGISTRY module-attribute

DBWRITE_REGISTRY = Registry(
    module="hubmodule", model="dbwrite", table_name="hubmodule_dbwrite"
)

The LaminHub database write log ("Changes → Database writes" in the LaminHub UI).

Registry dataclass

Registry(module: str, model: str, table_name: str)

A LaminDB registry (a Django model), addressed by schema module and model name.

resolve_registry

resolve_registry(
    schema: InstanceSchemaResponse, registry: LaminDBRegistry | Registry | str
) -> Registry

Resolve module.model (for example core.artifact or bionty.Gene) using an instance schema.

Without a module prefix, core is assumed. Model names are case-insensitive.

Source code in src/airflow/providers/lamindb/client/registries.py
def resolve_registry(schema: InstanceSchemaResponse, registry: LaminDBRegistry | Registry | str) -> Registry:
    """
    Resolve ``module.model`` (for example ``core.artifact`` or ``bionty.Gene``) using an instance schema.

    Without a module prefix, ``core`` is assumed. Model names are case-insensitive.
    """
    if isinstance(registry, Registry):
        return registry
    module, model = normalize_registry_name(registry)
    if (module, model) == (DBWRITE_REGISTRY.module, DBWRITE_REGISTRY.model):
        return DBWRITE_REGISTRY
    models = schema.root.get(module)
    if models is None:
        raise ValueError(f"Unknown schema module {module!r}; available modules: {sorted(schema.root)}")
    description = models.get(model)
    if description is None:
        raise ValueError(f"Unknown registry {module}.{model!s}; available models: {sorted(models)}")
    return Registry(module=module, model=model, table_name=description.table_name or f"{module}_{model}")

airflow.providers.lamindb.client.models

Validated wire models for the LaminHub REST API.

RecordQueryParams

Bases: _RequestModel

Query-string parameters; limit may span multiple HTTP pages.

RecordQueryBody

Bases: _RequestModel

Record query body after filter and sort normalization.

RecordOrder

Bases: _RequestModel

One normalized sort entry.

RecordScope

Bases: _RequestModel

An explicit branch scope, including an explicitly empty list.

RecordInsertBody

Bases: RootModel[list[dict[str, JsonValue]]]

Insert rows with registry-specific JSON fields.

RecordUpdateBody

Bases: RootModel[dict[str, JsonValue]]

Partial update; explicit nulls clear fields and must be retained.

TokenRequest

Bases: _RequestModel

API-key exchange body; the key is never included in the model repr.

TokenResponse

Bases: _ResponseModel

Only the access token is retained from the exchange response.

InstanceSettingsResponse

Bases: _ResponseModel

Non-sensitive instance settings; credentials and unknown fields are discarded.

ArtifactAux

Bases: _PartialRecordResponse

Known artifact upload metadata, retaining other auxiliary JSON fields.

ArtifactRecordResponse

Bases: _PartialRecordResponse

Known artifact fields; projections may omit them and other columns are retained.

DbWriteResponse

Bases: _PartialRecordResponse

Known database-write fields, with dynamic previous record values in data.

BranchRecordResponse

Bases: _PartialRecordResponse

Known branch fields, including its numeric workflow status.

BranchBlockRecordResponse

Bases: _PartialRecordResponse

Known comment/readme fields; content and extension fields are retained.

UserRecordResponse

Bases: _PartialRecordResponse

Known user identity fields used in event summaries.

RegistrySchemaResponse

Bases: _PartialRecordResponse

Known registry schema envelope; field descriptions are extensible JSON metadata.

InstanceSchemaResponse

Bases: RootModel[dict[str, dict[str, RegistrySchemaResponse]]]

Schema modules mapped to their model descriptions.

airflow.providers.lamindb.triggers.events

Validated trigger event and persistence envelopes.

RecordSensorOutcome module-attribute

RecordSensorOutcome = Annotated[
    RecordSensorSuccess | SensorError, Field(discriminator="status")
]

BranchSensorOutcome module-attribute

BranchSensorOutcome = Annotated[
    BranchSensorSuccess | BranchSensorFailure | SensorError,
    Field(discriminator="status"),
]

CursorValue

Bases: BaseModel

A persisted write-log position bound to one instance.

BranchSummary

Bases: _TriggerModel

Projected branch identity and its human-readable workflow status.

UserSummary

Bases: _TriggerModel

The actor included in write-log event payloads.

DbWriteEventPayload

Bases: _TriggerModel

Extensible common envelope for built-in and custom write-log events.

RecordEventPayload

Bases: DbWriteEventPayload

A registry record was created, updated or deleted.

BranchStatusEventPayload

Bases: DbWriteEventPayload

A branch changed workflow status, even if its current row is gone.

BranchBlockEventPayload

Bases: DbWriteEventPayload

A branch comment or readme was created.

SensorError

Bases: _TriggerModel

A non-transient error reported by either sensor trigger.

RecordSensorSuccess

Bases: _TriggerModel

Matching records, whose registry-specific columns remain dynamic.

BranchSensorSuccess

Bases: _TriggerModel

A branch that reached a target status.

BranchSensorFailure

Bases: _TriggerModel

A terminal branch status; legacy events may omit the branch summary.

airflow.providers.lamindb.execution.config

Worker-side models; only their plain dictionaries are sent to remote runtimes.

FlowRunParameters

Bases: _ExecutionModel

Fixed Airflow run identity and timing fields, with unrestricted DAG configuration.

ConnectedStepConfig

Bases: _ExecutionModel

Connection context for an untracked remote callable.

TrackedStepConfig

Bases: ConnectedStepConfig

Arguments passed to the dependency-free remote run_step runtime.

FlowStartConfig

Bases: ConnectedStepConfig

Arguments passed to the remote start_flow_run runtime.

FlowFinishConfig

Bases: _ExecutionModel

Arguments passed to the remote finish_flow_run runtime.

airflow.providers.lamindb.client.filters

Build, validate and evaluate LaminHub REST filters.

Filters select records by their fields. Build them with F and the field enums:

F(ArtifactField.KEY).startswith("raw/") & (F(ArtifactField.SIZE) > 1_000_000)

Filters in the JSON form of the LaminHub REST API, e.g. {"key": {"startswith": "raw/"}}, are converted with FilterExpression.from_dict.

F

F(*path: str)

A field to filter on, e.g. F(ArtifactField.KEY), F("key") or F("created_by.handle").

Compare it with a value to get a Condition, using Python's comparison operators (==, !=, >, >=, <, <=) or the methods of this class. Combine conditions with & (and) and | (or); as & and | bind more tightly than comparisons, wrap comparisons in parentheses:

(F(ArtifactField.SUFFIX) == ".parquet") & (F(ArtifactField.SIZE) > 1_000_000)
F(ArtifactField.KEY).startswith("raw/") | F(ArtifactField.KIND).is_in([ArtifactKind.DATASET])

Pass several fields to follow relations: F(ArtifactField.CREATED_BY, UserField.HANDLE) is the path created_by.handle. Index JSON fields with keys: F(RunField.PARAMS)["learning_rate"].

Parameters:

  • path (str, default: () ) –

    Field enum members or field names, e.g. ArtifactField.KEY or "key".

Source code in src/airflow/providers/lamindb/client/filters.py
def __init__(self, *path: str) -> None:
    if not path:
        raise ValueError("F() needs a field, e.g. F(ArtifactField.KEY) or F('key')")
    previous: str | None = None
    for part in path:
        if not isinstance(part, str) or not part:
            raise TypeError(f"Fields must be field enum members or non-empty strings, got {part!r}")
        if isinstance(previous, RegistryField):
            _check_relation_step(previous, part)
        previous = part
    self._path = ".".join(plain_value(part) for part in path)
    self._relation = previous if isinstance(previous, RegistryField) and previous.related else None

path property

path: str

The field path in the LaminHub REST format, e.g. created_by.handle.

op

op(operator: FilterOperator | str, value: Any) -> Condition

Compare with any FilterOperator, e.g. F("key").op(FilterOperator.EQ, "a.csv").

Source code in src/airflow/providers/lamindb/client/filters.py
def op(self, operator: FilterOperator | str, value: Any) -> Condition:
    """Compare with any [`FilterOperator`][], e.g. ``F("key").op(FilterOperator.EQ, "a.csv")``."""
    return Condition(self, operator, value)

eq

eq(value: Any) -> Condition

Equal to value (==); None selects null values.

Source code in src/airflow/providers/lamindb/client/filters.py
def eq(self, value: Any) -> Condition:
    """Equal to ``value`` (``==``); ``None`` selects ``null`` values."""
    return self.is_null() if value is None else Condition(self, FilterOperator.EQ, value)

ne

ne(value: Any) -> Condition

Distinct from value, including null values (!=); None selects non-null values.

Source code in src/airflow/providers/lamindb/client/filters.py
def ne(self, value: Any) -> Condition:
    """Distinct from ``value``, including ``null`` values (``!=``); ``None`` selects non-null values."""
    return self.is_not_null() if value is None else Condition(self, FilterOperator.NE, value)

gt

gt(value: str | float | date) -> Condition

Greater than value (>).

Source code in src/airflow/providers/lamindb/client/filters.py
def gt(self, value: str | float | datetime.date) -> Condition:
    """Greater than ``value`` (``>``)."""
    return Condition(self, FilterOperator.GT, value)

gte

gte(value: str | float | date) -> Condition

Greater than or equal to value (>=).

Source code in src/airflow/providers/lamindb/client/filters.py
def gte(self, value: str | float | datetime.date) -> Condition:
    """Greater than or equal to ``value`` (``>=``)."""
    return Condition(self, FilterOperator.GTE, value)

lt

lt(value: str | float | date) -> Condition

Less than value (<).

Source code in src/airflow/providers/lamindb/client/filters.py
def lt(self, value: str | float | datetime.date) -> Condition:
    """Less than ``value`` (``<``)."""
    return Condition(self, FilterOperator.LT, value)

lte

lte(value: str | float | date) -> Condition

Less than or equal to value (<=).

Source code in src/airflow/providers/lamindb/client/filters.py
def lte(self, value: str | float | datetime.date) -> Condition:
    """Less than or equal to ``value`` (``<=``)."""
    return Condition(self, FilterOperator.LTE, value)

is_in

is_in(values: Iterable[Any]) -> Condition

Equal to any of values; an empty list matches nothing.

Source code in src/airflow/providers/lamindb/client/filters.py
def is_in(self, values: Iterable[Any]) -> Condition:
    """Equal to any of ``values``; an empty list matches nothing."""
    return Condition(self, FilterOperator.IN, _as_list(values))

not_in

not_in(values: Iterable[Any]) -> Condition

Equal to none of values.

Source code in src/airflow/providers/lamindb/client/filters.py
def not_in(self, values: Iterable[Any]) -> Condition:
    """Equal to none of ``values``."""
    return Condition(self, FilterOperator.NOT_IN, _as_list(values))

is_null

is_null() -> Condition

The field is null.

Source code in src/airflow/providers/lamindb/client/filters.py
def is_null(self) -> Condition:
    """The field is ``null``."""
    return Condition(self, FilterOperator.IS_NULL, True)

is_not_null

is_not_null() -> Condition

The field is not null.

Source code in src/airflow/providers/lamindb/client/filters.py
def is_not_null(self) -> Condition:
    """The field is not ``null``."""
    return Condition(self, FilterOperator.IS_NULL, False)

startswith

startswith(prefix: str) -> Condition

The string starts with prefix (case-sensitive).

Source code in src/airflow/providers/lamindb/client/filters.py
def startswith(self, prefix: str) -> Condition:
    """The string starts with ``prefix`` (case-sensitive)."""
    return Condition(self, FilterOperator.STARTSWITH, prefix)

endswith

endswith(suffix: str) -> Condition

The string ends with suffix (case-sensitive).

Source code in src/airflow/providers/lamindb/client/filters.py
def endswith(self, suffix: str) -> Condition:
    """The string ends with ``suffix`` (case-sensitive)."""
    return Condition(self, FilterOperator.ENDSWITH, suffix)

contains

contains(value: str | float | bool) -> Condition

The string contains value (case-sensitive), or the JSON array has the element value.

Source code in src/airflow/providers/lamindb/client/filters.py
def contains(self, value: str | float | bool) -> Condition:
    """The string contains ``value`` (case-sensitive), or the JSON array has the element ``value``."""
    return Condition(self, FilterOperator.CONTAINS, value)

count

count() -> Count

The number of related records, e.g. F(TransformField.RUNS).count() >= 2.

Source code in src/airflow/providers/lamindb/client/filters.py
def count(self) -> Count:
    """The number of related records, e.g. ``F(TransformField.RUNS).count() >= 2``."""
    return Count(self)

Count

Count(field: F)

The number of related records of a relation, see F.count.

Source code in src/airflow/providers/lamindb/client/filters.py
def __init__(self, field: F) -> None:
    field._count_path()  # fail early for fields that can't be counted
    self._field = field

eq

eq(n: int) -> Condition

Exactly n related records (==).

Source code in src/airflow/providers/lamindb/client/filters.py
def eq(self, n: int) -> Condition:
    """Exactly ``n`` related records (``==``)."""
    return Condition(self._field, FilterOperator.COUNT_EQ, n)

ne

ne(n: int) -> Condition

Not exactly n related records (!=).

Source code in src/airflow/providers/lamindb/client/filters.py
def ne(self, n: int) -> Condition:
    """Not exactly ``n`` related records (``!=``)."""
    return Condition(self._field, FilterOperator.COUNT_NE, n)

gt

gt(n: int) -> Condition

More than n related records (>).

Source code in src/airflow/providers/lamindb/client/filters.py
def gt(self, n: int) -> Condition:
    """More than ``n`` related records (``>``)."""
    return Condition(self._field, FilterOperator.COUNT_GT, n)

gte

gte(n: int) -> Condition

At least n related records (>=).

Source code in src/airflow/providers/lamindb/client/filters.py
def gte(self, n: int) -> Condition:
    """At least ``n`` related records (``>=``)."""
    return Condition(self._field, FilterOperator.COUNT_GTE, n)

lt

lt(n: int) -> Condition

Fewer than n related records (<).

Source code in src/airflow/providers/lamindb/client/filters.py
def lt(self, n: int) -> Condition:
    """Fewer than ``n`` related records (``<``)."""
    return Condition(self._field, FilterOperator.COUNT_LT, n)

lte

lte(n: int) -> Condition

At most n related records (<=).

Source code in src/airflow/providers/lamindb/client/filters.py
def lte(self, n: int) -> Condition:
    """At most ``n`` related records (``<=``)."""
    return Condition(self._field, FilterOperator.COUNT_LTE, n)

FilterExpression

Base class of filters built in Python: Condition, And and Or.

Combine filters with & (and) and | (or). to_dict returns the JSON form that the LaminHub REST API expects, and from_dict parses it.

to_dict

to_dict() -> dict[str, Any]

Return the filter in the JSON form of the LaminHub REST API.

Source code in src/airflow/providers/lamindb/client/filters.py
def to_dict(self) -> dict[str, Any]:
    """Return the filter in the JSON form of the LaminHub REST API."""
    raise NotImplementedError

from_dict staticmethod

from_dict(node: Mapping[str, Any]) -> FilterExpression

Parse and validate a LaminHub REST filter, e.g. {"key": {"eq": "raw/a.csv"}}.

Source code in src/airflow/providers/lamindb/client/filters.py
@staticmethod
def from_dict(node: Mapping[str, Any]) -> FilterExpression:
    """Parse and validate a LaminHub REST filter, e.g. ``{"key": {"eq": "raw/a.csv"}}``."""
    if not isinstance(node, Mapping) or len(node) != 1:
        raise ValueError(
            f"Filters must have exactly one key, a field or 'and'/'or', got {node!r}; "
            "combine conditions with {'and': [...]}"
        )
    ((key, value),) = node.items()
    if plain_value(key) in ("and", "or"):
        group = plain_value(key)
        if not isinstance(value, (list, tuple)) or not value:
            raise ValueError(f"{group!r} expects a non-empty list of filters, got {value!r}")
        return (And if group == "and" else Or)(*map(_child_from_dict, value))
    if not isinstance(value, Mapping) or len(value) != 1:
        raise ValueError(
            f"The condition on {key!r} must have exactly one operator, e.g. {{'eq': ...}}, got {value!r}"
        )
    ((operator, operand),) = value.items()
    return Condition(key, operator, operand)

Condition

Condition(field: F | str, operator: FilterOperator | str, value: Any)

Bases: FilterExpression

A condition on a field, e.g. Condition(ArtifactField.KEY, FilterOperator.STARTSWITH, "raw/").

Comparing an F creates conditions too, e.g. F(ArtifactField.KEY).startswith("raw/").

Parameters:

  • field (F | str) –

    The field, as an F, a field enum member or a field name.

  • operator (FilterOperator | str) –

    A FilterOperator or its name, e.g. "startswith".

  • value (Any) –

    The value to compare with; enum members, dates, tuples and sets are converted to their JSON form.

Source code in src/airflow/providers/lamindb/client/filters.py
def __init__(self, field: F | str, operator: FilterOperator | str, value: Any) -> None:
    if not isinstance(field, F):
        field = F(field)
    try:
        operator = FilterOperator(operator)
    except ValueError:
        raise ValueError(
            f"Unknown filter operator {plain_value(operator)!r} on {field.path!r}; expected one of "
            f"{', '.join(op.value for op in FilterOperator)}"
        ) from None
    if operator.is_count:
        path = field._count_path()
    elif field._relation is not None:
        raise ValueError(_relation_hint(field._relation))
    else:
        path = field.path
    self.path = path
    self.operator = operator
    self.value = _check_value(operator, value, path)

And

And(*filters: FilterExpression)

Bases: _Group

All filters match, e.g. And(F("suffix") == ".csv", F("size") > 0); like &.

Source code in src/airflow/providers/lamindb/client/filters.py
def __init__(self, *filters: FilterExpression) -> None:
    if not filters:
        raise ValueError(f"{type(self).__name__}() needs at least one filter")
    self.filters: tuple[FilterExpression, ...] = tuple(_as_expression(f) for f in filters)

Or

Or(*filters: FilterExpression)

Bases: _Group

At least one filter matches, e.g. Or(F("suffix") == ".csv", F("suffix") == ".tsv"); like |.

Source code in src/airflow/providers/lamindb/client/filters.py
def __init__(self, *filters: FilterExpression) -> None:
    if not filters:
        raise ValueError(f"{type(self).__name__}() needs at least one filter")
    self.filters: tuple[FilterExpression, ...] = tuple(_as_expression(f) for f in filters)

airflow.providers.lamindb.client.enums

Enums for building LaminHub REST filters: registries, filter operators, registry fields and values.

The field enums reflect the core registries of LaminDB 2.11. Use them with F, for example F(ArtifactField.KEY) == "raw/a.csv". Plain strings work for every field, including fields of other schema modules such as bionty.

LaminDBRegistry

Bases: _StrEnum

Registries (module.model) to pass as registry to sensors, triggers and the hook.

ARTIFACT class-attribute instance-attribute

ARTIFACT = 'core.artifact'

COLLECTION class-attribute instance-attribute

COLLECTION = 'core.collection'

RUN class-attribute instance-attribute

RUN = 'core.run'

TRANSFORM class-attribute instance-attribute

TRANSFORM = 'core.transform'

RECORD class-attribute instance-attribute

RECORD = 'core.record'

ULABEL class-attribute instance-attribute

ULABEL = 'core.ulabel'

FEATURE class-attribute instance-attribute

FEATURE = 'core.feature'

SCHEMA class-attribute instance-attribute

SCHEMA = 'core.schema'

PROJECT class-attribute instance-attribute

PROJECT = 'core.project'

REFERENCE class-attribute instance-attribute

REFERENCE = 'core.reference'

STORAGE class-attribute instance-attribute

STORAGE = 'core.storage'

BRANCH class-attribute instance-attribute

BRANCH = 'core.branch'

SPACE class-attribute instance-attribute

SPACE = 'core.space'

USER class-attribute instance-attribute

USER = 'core.user'

BIONTY_CELL_LINE class-attribute instance-attribute

BIONTY_CELL_LINE = 'bionty.cellline'

BIONTY_CELL_MARKER class-attribute instance-attribute

BIONTY_CELL_MARKER = 'bionty.cellmarker'

BIONTY_CELL_TYPE class-attribute instance-attribute

BIONTY_CELL_TYPE = 'bionty.celltype'

BIONTY_DEVELOPMENTAL_STAGE class-attribute instance-attribute

BIONTY_DEVELOPMENTAL_STAGE = 'bionty.developmentalstage'

BIONTY_DISEASE class-attribute instance-attribute

BIONTY_DISEASE = 'bionty.disease'

BIONTY_ETHNICITY class-attribute instance-attribute

BIONTY_ETHNICITY = 'bionty.ethnicity'

BIONTY_EXPERIMENTAL_FACTOR class-attribute instance-attribute

BIONTY_EXPERIMENTAL_FACTOR = 'bionty.experimentalfactor'

BIONTY_GENE class-attribute instance-attribute

BIONTY_GENE = 'bionty.gene'

BIONTY_ORGANISM class-attribute instance-attribute

BIONTY_ORGANISM = 'bionty.organism'

BIONTY_PATHWAY class-attribute instance-attribute

BIONTY_PATHWAY = 'bionty.pathway'

BIONTY_PHENOTYPE class-attribute instance-attribute

BIONTY_PHENOTYPE = 'bionty.phenotype'

BIONTY_PROTEIN class-attribute instance-attribute

BIONTY_PROTEIN = 'bionty.protein'

BIONTY_SOURCE class-attribute instance-attribute

BIONTY_SOURCE = 'bionty.source'

BIONTY_TISSUE class-attribute instance-attribute

BIONTY_TISSUE = 'bionty.tissue'

FilterOperator

Bases: _StrEnum

Operators of LaminHub REST filters, see https://docs.lamin.ai/rest.

EQ class-attribute instance-attribute

EQ = 'eq'

Equal to the value.

NE class-attribute instance-attribute

NE = 'ne'

Distinct from the value, including null on SQL columns.

GT class-attribute instance-attribute

GT = 'gt'

Greater than the value (a string or number).

GTE class-attribute instance-attribute

GTE = 'gte'

Greater than or equal to the value (a string or number).

LT class-attribute instance-attribute

LT = 'lt'

Less than the value (a string or number).

LTE class-attribute instance-attribute

LTE = 'lte'

Less than or equal to the value (a string or number).

IN class-attribute instance-attribute

IN = 'in'

Equal to any of the listed values; an empty list matches nothing.

NOT_IN class-attribute instance-attribute

NOT_IN = 'notin'

Equal to none of the listed values.

IS_NULL class-attribute instance-attribute

IS_NULL = 'isnull'

True selects null values, False selects non-null values.

STARTSWITH class-attribute instance-attribute

STARTSWITH = 'startswith'

Case-sensitive prefix.

ENDSWITH class-attribute instance-attribute

ENDSWITH = 'endswith'

Case-sensitive suffix.

CONTAINS class-attribute instance-attribute

CONTAINS = 'contains'

Case-sensitive substring of strings, or element of JSON arrays.

COUNT_EQ class-attribute instance-attribute

COUNT_EQ = 'count_eq'

Number of related records equals the value.

COUNT_NE class-attribute instance-attribute

COUNT_NE = 'count_ne'

Number of related records differs from the value.

COUNT_GT class-attribute instance-attribute

COUNT_GT = 'count_gt'

Number of related records is greater than the value.

COUNT_GTE class-attribute instance-attribute

COUNT_GTE = 'count_gte'

Number of related records is at least the value.

COUNT_LT class-attribute instance-attribute

COUNT_LT = 'count_lt'

Number of related records is less than the value.

COUNT_LTE class-attribute instance-attribute

COUNT_LTE = 'count_lte'

Number of related records is at most the value.

is_count property

is_count: bool

Whether the operator compares the number of related records.

ArtifactKind

Bases: _StrEnum

Values of ArtifactField.KIND.

DATASET class-attribute instance-attribute

DATASET = 'dataset'

MODEL class-attribute instance-attribute

MODEL = 'model'

PLAN class-attribute instance-attribute

PLAN = 'plan'

LAMINDB_RUN class-attribute instance-attribute

LAMINDB_RUN = '__lamindb_run__'

Created by LaminDB for runs (logs, reports, environments).

LAMINDB_CONFIG class-attribute instance-attribute

LAMINDB_CONFIG = '__lamindb_config__'

Created by LaminDB for configurations.

TransformKind

Bases: _StrEnum

Values of TransformField.KIND.

PIPELINE class-attribute instance-attribute

PIPELINE = 'pipeline'

NOTEBOOK class-attribute instance-attribute

NOTEBOOK = 'notebook'

SCRIPT class-attribute instance-attribute

SCRIPT = 'script'

FUNCTION class-attribute instance-attribute

FUNCTION = 'function'

RunStatus

Bases: IntEnum

Run statuses, as the codes stored in RunField.STATUS_CODE.

SCHEDULED class-attribute instance-attribute

SCHEDULED = -3

RESTARTED class-attribute instance-attribute

RESTARTED = -2

STARTED class-attribute instance-attribute

STARTED = -1

COMPLETED class-attribute instance-attribute

COMPLETED = 0

ERRORED class-attribute instance-attribute

ERRORED = 1

ABORTED class-attribute instance-attribute

ABORTED = 2

RegistryField

Bases: _StrEnum

Base class of the registry field enums.

Members that are relations know the registry they point to (related), so that F can follow them, for example F(ArtifactField.CREATED_BY, UserField.HANDLE). Foreign keys (..._ID members) hold the id of the related record and can be compared directly.

related instance-attribute

related: LaminDBRegistry | None

ArtifactField

Bases: RegistryField

Fields of core.artifact (LaminDBRegistry.ARTIFACT).

ID class-attribute instance-attribute

ID = 'id'

UID class-attribute instance-attribute

UID = 'uid'

CREATED_AT class-attribute instance-attribute

CREATED_AT = 'created_at'

DESCRIPTION class-attribute instance-attribute

DESCRIPTION = 'description'

EXTRA_DATA class-attribute instance-attribute

EXTRA_DATA = 'extra_data'

HASH class-attribute instance-attribute

HASH = 'hash'

IS_LATEST class-attribute instance-attribute

IS_LATEST = 'is_latest'

IS_LOCKED class-attribute instance-attribute

IS_LOCKED = 'is_locked'

KEY class-attribute instance-attribute

KEY = 'key'

KIND class-attribute instance-attribute

KIND = 'kind'

N_FILES class-attribute instance-attribute

N_FILES = 'n_files'

N_OBSERVATIONS class-attribute instance-attribute

N_OBSERVATIONS = 'n_observations'

OTYPE class-attribute instance-attribute

OTYPE = 'otype'

SIZE class-attribute instance-attribute

SIZE = 'size'

SUFFIX class-attribute instance-attribute

SUFFIX = 'suffix'

UPDATED_AT class-attribute instance-attribute

UPDATED_AT = 'updated_at'

VERSION_TAG class-attribute instance-attribute

VERSION_TAG = 'version_tag'

BRANCH_ID class-attribute instance-attribute

BRANCH_ID = 'branch_id'

CREATED_BY_ID class-attribute instance-attribute

CREATED_BY_ID = 'created_by_id'

CREATED_ON_ID class-attribute instance-attribute

CREATED_ON_ID = 'created_on_id'

RUN_ID class-attribute instance-attribute

RUN_ID = 'run_id'

SCHEMA_ID class-attribute instance-attribute

SCHEMA_ID = 'schema_id'

SPACE_ID class-attribute instance-attribute

SPACE_ID = 'space_id'

STORAGE_ID class-attribute instance-attribute

STORAGE_ID = 'storage_id'

BRANCH class-attribute instance-attribute

BRANCH = ('branch', LaminDBRegistry.BRANCH)

CREATED_BY class-attribute instance-attribute

CREATED_BY = ('created_by', LaminDBRegistry.USER)

CREATED_ON class-attribute instance-attribute

CREATED_ON = ('created_on', LaminDBRegistry.BRANCH)

RUN class-attribute instance-attribute

RUN = ('run', LaminDBRegistry.RUN)

SCHEMA class-attribute instance-attribute

SCHEMA = ('schema', LaminDBRegistry.SCHEMA)

SPACE class-attribute instance-attribute

SPACE = ('space', LaminDBRegistry.SPACE)

STORAGE class-attribute instance-attribute

STORAGE = ('storage', LaminDBRegistry.STORAGE)

ARTIFACTS class-attribute instance-attribute

ARTIFACTS = ('artifacts', LaminDBRegistry.ARTIFACT)

COLLECTIONS class-attribute instance-attribute

COLLECTIONS = ('collections', LaminDBRegistry.COLLECTION)

INPUT_OF_RUNS class-attribute instance-attribute

INPUT_OF_RUNS = ('input_of_runs', LaminDBRegistry.RUN)

LINKED_BY_ARTIFACTS class-attribute instance-attribute

LINKED_BY_ARTIFACTS = ('linked_by_artifacts', LaminDBRegistry.ARTIFACT)

LINKED_BY_RUNS class-attribute instance-attribute

LINKED_BY_RUNS = ('linked_by_runs', LaminDBRegistry.RUN)

LINKED_IN_RECORDS class-attribute instance-attribute

LINKED_IN_RECORDS = ('linked_in_records', LaminDBRegistry.RECORD)

PROJECTS class-attribute instance-attribute

PROJECTS = ('projects', LaminDBRegistry.PROJECT)

RECORDS class-attribute instance-attribute

RECORDS = ('records', LaminDBRegistry.RECORD)

RECREATING_RUNS class-attribute instance-attribute

RECREATING_RUNS = ('recreating_runs', LaminDBRegistry.RUN)

REFERENCES class-attribute instance-attribute

REFERENCES = ('references', LaminDBRegistry.REFERENCE)

RUNS class-attribute instance-attribute

RUNS = ('runs', LaminDBRegistry.RUN)

SCHEMAS class-attribute instance-attribute

SCHEMAS = ('schemas', LaminDBRegistry.SCHEMA)

ULABELS class-attribute instance-attribute

ULABELS = ('ulabels', LaminDBRegistry.ULABEL)

USERS class-attribute instance-attribute

USERS = ('users', LaminDBRegistry.USER)

CollectionField

Bases: RegistryField

Fields of core.collection (LaminDBRegistry.COLLECTION).

ID class-attribute instance-attribute

ID = 'id'

UID class-attribute instance-attribute

UID = 'uid'

CREATED_AT class-attribute instance-attribute

CREATED_AT = 'created_at'

DESCRIPTION class-attribute instance-attribute

DESCRIPTION = 'description'

HASH class-attribute instance-attribute

HASH = 'hash'

IS_LATEST class-attribute instance-attribute

IS_LATEST = 'is_latest'

IS_LOCKED class-attribute instance-attribute

IS_LOCKED = 'is_locked'

KEY class-attribute instance-attribute

KEY = 'key'

REFERENCE class-attribute instance-attribute

REFERENCE = 'reference'

REFERENCE_TYPE class-attribute instance-attribute

REFERENCE_TYPE = 'reference_type'

UPDATED_AT class-attribute instance-attribute

UPDATED_AT = 'updated_at'

VERSION_TAG class-attribute instance-attribute

VERSION_TAG = 'version_tag'

BRANCH_ID class-attribute instance-attribute

BRANCH_ID = 'branch_id'

CREATED_BY_ID class-attribute instance-attribute

CREATED_BY_ID = 'created_by_id'

CREATED_ON_ID class-attribute instance-attribute

CREATED_ON_ID = 'created_on_id'

META_ARTIFACT_ID class-attribute instance-attribute

META_ARTIFACT_ID = 'meta_artifact_id'

RUN_ID class-attribute instance-attribute

RUN_ID = 'run_id'

SCHEMA_ID class-attribute instance-attribute

SCHEMA_ID = 'schema_id'

SPACE_ID class-attribute instance-attribute

SPACE_ID = 'space_id'

BRANCH class-attribute instance-attribute

BRANCH = ('branch', LaminDBRegistry.BRANCH)

CREATED_BY class-attribute instance-attribute

CREATED_BY = ('created_by', LaminDBRegistry.USER)

CREATED_ON class-attribute instance-attribute

CREATED_ON = ('created_on', LaminDBRegistry.BRANCH)

META_ARTIFACT class-attribute instance-attribute

META_ARTIFACT = ('meta_artifact', LaminDBRegistry.ARTIFACT)

RUN class-attribute instance-attribute

RUN = ('run', LaminDBRegistry.RUN)

SCHEMA class-attribute instance-attribute

SCHEMA = ('schema', LaminDBRegistry.SCHEMA)

SPACE class-attribute instance-attribute

SPACE = ('space', LaminDBRegistry.SPACE)

ARTIFACTS class-attribute instance-attribute

ARTIFACTS = ('artifacts', LaminDBRegistry.ARTIFACT)

INPUT_OF_RUNS class-attribute instance-attribute

INPUT_OF_RUNS = ('input_of_runs', LaminDBRegistry.RUN)

LINKED_IN_RECORDS class-attribute instance-attribute

LINKED_IN_RECORDS = ('linked_in_records', LaminDBRegistry.RECORD)

PROJECTS class-attribute instance-attribute

PROJECTS = ('projects', LaminDBRegistry.PROJECT)

RECORDS class-attribute instance-attribute

RECORDS = ('records', LaminDBRegistry.RECORD)

RECREATING_RUNS class-attribute instance-attribute

RECREATING_RUNS = ('recreating_runs', LaminDBRegistry.RUN)

REFERENCES class-attribute instance-attribute

REFERENCES = ('references', LaminDBRegistry.REFERENCE)

ULABELS class-attribute instance-attribute

ULABELS = ('ulabels', LaminDBRegistry.ULABEL)

RunField

Bases: RegistryField

Fields of core.run (LaminDBRegistry.RUN).

ID class-attribute instance-attribute

ID = 'id'

UID class-attribute instance-attribute

UID = 'uid'

CLI_ARGS class-attribute instance-attribute

CLI_ARGS = 'cli_args'

CREATED_AT class-attribute instance-attribute

CREATED_AT = 'created_at'

DESCRIPTION class-attribute instance-attribute

DESCRIPTION = 'description'

ENTRYPOINT class-attribute instance-attribute

ENTRYPOINT = 'entrypoint'

EXTRA_DATA class-attribute instance-attribute

EXTRA_DATA = 'extra_data'

FINISHED_AT class-attribute instance-attribute

FINISHED_AT = 'finished_at'

IS_LOCKED class-attribute instance-attribute

IS_LOCKED = 'is_locked'

NAME class-attribute instance-attribute

NAME = 'name'

PARAMS class-attribute instance-attribute

PARAMS = 'params'

REFERENCE class-attribute instance-attribute

REFERENCE = 'reference'

REFERENCE_TYPE class-attribute instance-attribute

REFERENCE_TYPE = 'reference_type'

STARTED_AT class-attribute instance-attribute

STARTED_AT = 'started_at'

STATUS_CODE class-attribute instance-attribute

STATUS_CODE = '_status_code'

The run status as a code, compare it with RunStatus.

UPDATED_AT class-attribute instance-attribute

UPDATED_AT = 'updated_at'

BRANCH_ID class-attribute instance-attribute

BRANCH_ID = 'branch_id'

CREATED_BY_ID class-attribute instance-attribute

CREATED_BY_ID = 'created_by_id'

CREATED_ON_ID class-attribute instance-attribute

CREATED_ON_ID = 'created_on_id'

ENVIRONMENT_ID class-attribute instance-attribute

ENVIRONMENT_ID = 'environment_id'

INITIATED_BY_RUN_ID class-attribute instance-attribute

INITIATED_BY_RUN_ID = 'initiated_by_run_id'

PLAN_ID class-attribute instance-attribute

PLAN_ID = 'plan_id'

REPORT_ID class-attribute instance-attribute

REPORT_ID = 'report_id'

SPACE_ID class-attribute instance-attribute

SPACE_ID = 'space_id'

TRANSFORM_ID class-attribute instance-attribute

TRANSFORM_ID = 'transform_id'

BRANCH class-attribute instance-attribute

BRANCH = ('branch', LaminDBRegistry.BRANCH)

CREATED_BY class-attribute instance-attribute

CREATED_BY = ('created_by', LaminDBRegistry.USER)

CREATED_ON class-attribute instance-attribute

CREATED_ON = ('created_on', LaminDBRegistry.BRANCH)

ENVIRONMENT class-attribute instance-attribute

ENVIRONMENT = ('environment', LaminDBRegistry.ARTIFACT)

INITIATED_BY_RUN class-attribute instance-attribute

INITIATED_BY_RUN = ('initiated_by_run', LaminDBRegistry.RUN)

PLAN class-attribute instance-attribute

PLAN = ('plan', LaminDBRegistry.ARTIFACT)

REPORT class-attribute instance-attribute

REPORT = ('report', LaminDBRegistry.ARTIFACT)

SPACE class-attribute instance-attribute

SPACE = ('space', LaminDBRegistry.SPACE)

TRANSFORM class-attribute instance-attribute

TRANSFORM = ('transform', LaminDBRegistry.TRANSFORM)

ARTIFACTS class-attribute instance-attribute

ARTIFACTS = ('artifacts', LaminDBRegistry.ARTIFACT)

INPUT_ARTIFACTS class-attribute instance-attribute

INPUT_ARTIFACTS = ('input_artifacts', LaminDBRegistry.ARTIFACT)

INPUT_COLLECTIONS class-attribute instance-attribute

INPUT_COLLECTIONS = ('input_collections', LaminDBRegistry.COLLECTION)

INPUT_RECORDS class-attribute instance-attribute

INPUT_RECORDS = ('input_records', LaminDBRegistry.RECORD)

LINKED_ARTIFACTS class-attribute instance-attribute

LINKED_ARTIFACTS = ('linked_artifacts', LaminDBRegistry.ARTIFACT)

LINKED_IN_RECORDS class-attribute instance-attribute

LINKED_IN_RECORDS = ('linked_in_records', LaminDBRegistry.RECORD)

OUTPUT_ARTIFACTS class-attribute instance-attribute

OUTPUT_ARTIFACTS = ('output_artifacts', LaminDBRegistry.ARTIFACT)

OUTPUT_COLLECTIONS class-attribute instance-attribute

OUTPUT_COLLECTIONS = ('output_collections', LaminDBRegistry.COLLECTION)

OUTPUT_RECORDS class-attribute instance-attribute

OUTPUT_RECORDS = ('output_records', LaminDBRegistry.RECORD)

OUTPUT_TRANSFORMS class-attribute instance-attribute

OUTPUT_TRANSFORMS = ('output_transforms', LaminDBRegistry.TRANSFORM)

PROJECTS class-attribute instance-attribute

PROJECTS = ('projects', LaminDBRegistry.PROJECT)

RECORDS class-attribute instance-attribute

RECORDS = ('records', LaminDBRegistry.RECORD)

RECREATED_ARTIFACTS class-attribute instance-attribute

RECREATED_ARTIFACTS = ('recreated_artifacts', LaminDBRegistry.ARTIFACT)

RECREATED_COLLECTIONS class-attribute instance-attribute

RECREATED_COLLECTIONS = ('recreated_collections', LaminDBRegistry.COLLECTION)

ULABELS class-attribute instance-attribute

ULABELS = ('ulabels', LaminDBRegistry.ULABEL)

TransformField

Bases: RegistryField

Fields of core.transform (LaminDBRegistry.TRANSFORM).

ID class-attribute instance-attribute

ID = 'id'

UID class-attribute instance-attribute

UID = 'uid'

CREATED_AT class-attribute instance-attribute

CREATED_AT = 'created_at'

DESCRIPTION class-attribute instance-attribute

DESCRIPTION = 'description'

HASH class-attribute instance-attribute

HASH = 'hash'

IS_LATEST class-attribute instance-attribute

IS_LATEST = 'is_latest'

IS_LOCKED class-attribute instance-attribute

IS_LOCKED = 'is_locked'

KEY class-attribute instance-attribute

KEY = 'key'

KIND class-attribute instance-attribute

KIND = 'kind'

REFERENCE class-attribute instance-attribute

REFERENCE = 'reference'

REFERENCE_TYPE class-attribute instance-attribute

REFERENCE_TYPE = 'reference_type'

SOURCE_CODE class-attribute instance-attribute

SOURCE_CODE = 'source_code'

UPDATED_AT class-attribute instance-attribute

UPDATED_AT = 'updated_at'

VERSION_TAG class-attribute instance-attribute

VERSION_TAG = 'version_tag'

BRANCH_ID class-attribute instance-attribute

BRANCH_ID = 'branch_id'

CREATED_BY_ID class-attribute instance-attribute

CREATED_BY_ID = 'created_by_id'

CREATED_ON_ID class-attribute instance-attribute

CREATED_ON_ID = 'created_on_id'

ENVIRONMENT_ID class-attribute instance-attribute

ENVIRONMENT_ID = 'environment_id'

PLAN_ID class-attribute instance-attribute

PLAN_ID = 'plan_id'

RUN_ID class-attribute instance-attribute

RUN_ID = 'run_id'

SPACE_ID class-attribute instance-attribute

SPACE_ID = 'space_id'

BRANCH class-attribute instance-attribute

BRANCH = ('branch', LaminDBRegistry.BRANCH)

CREATED_BY class-attribute instance-attribute

CREATED_BY = ('created_by', LaminDBRegistry.USER)

CREATED_ON class-attribute instance-attribute

CREATED_ON = ('created_on', LaminDBRegistry.BRANCH)

ENVIRONMENT class-attribute instance-attribute

ENVIRONMENT = ('environment', LaminDBRegistry.ARTIFACT)

PLAN class-attribute instance-attribute

PLAN = ('plan', LaminDBRegistry.ARTIFACT)

RUN class-attribute instance-attribute

RUN = ('run', LaminDBRegistry.RUN)

SPACE class-attribute instance-attribute

SPACE = ('space', LaminDBRegistry.SPACE)

LINKED_IN_RECORDS class-attribute instance-attribute

LINKED_IN_RECORDS = ('linked_in_records', LaminDBRegistry.RECORD)

PREDECESSORS class-attribute instance-attribute

PREDECESSORS = ('predecessors', LaminDBRegistry.TRANSFORM)

PROJECTS class-attribute instance-attribute

PROJECTS = ('projects', LaminDBRegistry.PROJECT)

RECORDS class-attribute instance-attribute

RECORDS = ('records', LaminDBRegistry.RECORD)

REFERENCES class-attribute instance-attribute

REFERENCES = ('references', LaminDBRegistry.REFERENCE)

RUNS class-attribute instance-attribute

RUNS = ('runs', LaminDBRegistry.RUN)

SUCCESSORS class-attribute instance-attribute

SUCCESSORS = ('successors', LaminDBRegistry.TRANSFORM)

ULABELS class-attribute instance-attribute

ULABELS = ('ulabels', LaminDBRegistry.ULABEL)

RecordField

Bases: RegistryField

Fields of core.record (LaminDBRegistry.RECORD).

ID class-attribute instance-attribute

ID = 'id'

UID class-attribute instance-attribute

UID = 'uid'

CREATED_AT class-attribute instance-attribute

CREATED_AT = 'created_at'

DESCRIPTION class-attribute instance-attribute

DESCRIPTION = 'description'

EXTRA_DATA class-attribute instance-attribute

EXTRA_DATA = 'extra_data'

IS_LOCKED class-attribute instance-attribute

IS_LOCKED = 'is_locked'

IS_TYPE class-attribute instance-attribute

IS_TYPE = 'is_type'

NAME class-attribute instance-attribute

NAME = 'name'

REFERENCE class-attribute instance-attribute

REFERENCE = 'reference'

REFERENCE_TYPE class-attribute instance-attribute

REFERENCE_TYPE = 'reference_type'

UPDATED_AT class-attribute instance-attribute

UPDATED_AT = 'updated_at'

BRANCH_ID class-attribute instance-attribute

BRANCH_ID = 'branch_id'

CREATED_BY_ID class-attribute instance-attribute

CREATED_BY_ID = 'created_by_id'

CREATED_ON_ID class-attribute instance-attribute

CREATED_ON_ID = 'created_on_id'

RUN_ID class-attribute instance-attribute

RUN_ID = 'run_id'

SCHEMA_ID class-attribute instance-attribute

SCHEMA_ID = 'schema_id'

SPACE_ID class-attribute instance-attribute

SPACE_ID = 'space_id'

TYPE_ID class-attribute instance-attribute

TYPE_ID = 'type_id'

BRANCH class-attribute instance-attribute

BRANCH = ('branch', LaminDBRegistry.BRANCH)

CREATED_BY class-attribute instance-attribute

CREATED_BY = ('created_by', LaminDBRegistry.USER)

CREATED_ON class-attribute instance-attribute

CREATED_ON = ('created_on', LaminDBRegistry.BRANCH)

RUN class-attribute instance-attribute

RUN = ('run', LaminDBRegistry.RUN)

SCHEMA class-attribute instance-attribute

SCHEMA = ('schema', LaminDBRegistry.SCHEMA)

SPACE class-attribute instance-attribute

SPACE = ('space', LaminDBRegistry.SPACE)

TYPE class-attribute instance-attribute

TYPE = ('type', LaminDBRegistry.RECORD)

ARTIFACTS class-attribute instance-attribute

ARTIFACTS = ('artifacts', LaminDBRegistry.ARTIFACT)

CHILDREN class-attribute instance-attribute

CHILDREN = ('children', LaminDBRegistry.RECORD)

COLLECTIONS class-attribute instance-attribute

COLLECTIONS = ('collections', LaminDBRegistry.COLLECTION)

INPUT_OF_RUNS class-attribute instance-attribute

INPUT_OF_RUNS = ('input_of_runs', LaminDBRegistry.RUN)

LINKED_ARTIFACTS class-attribute instance-attribute

LINKED_ARTIFACTS = ('linked_artifacts', LaminDBRegistry.ARTIFACT)

LINKED_COLLECTIONS class-attribute instance-attribute

LINKED_COLLECTIONS = ('linked_collections', LaminDBRegistry.COLLECTION)

LINKED_IN_RECORDS class-attribute instance-attribute

LINKED_IN_RECORDS = ('linked_in_records', LaminDBRegistry.RECORD)

LINKED_PROJECTS class-attribute instance-attribute

LINKED_PROJECTS = ('linked_projects', LaminDBRegistry.PROJECT)

LINKED_RECORDS class-attribute instance-attribute

LINKED_RECORDS = ('linked_records', LaminDBRegistry.RECORD)

LINKED_REFERENCES class-attribute instance-attribute

LINKED_REFERENCES = ('linked_references', LaminDBRegistry.REFERENCE)

LINKED_RUNS class-attribute instance-attribute

LINKED_RUNS = ('linked_runs', LaminDBRegistry.RUN)

LINKED_TRANSFORMS class-attribute instance-attribute

LINKED_TRANSFORMS = ('linked_transforms', LaminDBRegistry.TRANSFORM)

LINKED_ULABELS class-attribute instance-attribute

LINKED_ULABELS = ('linked_ulabels', LaminDBRegistry.ULABEL)

LINKED_USERS class-attribute instance-attribute

LINKED_USERS = ('linked_users', LaminDBRegistry.USER)

PARENTS class-attribute instance-attribute

PARENTS = ('parents', LaminDBRegistry.RECORD)

PROJECTS class-attribute instance-attribute

PROJECTS = ('projects', LaminDBRegistry.PROJECT)

REFERENCES class-attribute instance-attribute

REFERENCES = ('references', LaminDBRegistry.REFERENCE)

RUNS class-attribute instance-attribute

RUNS = ('runs', LaminDBRegistry.RUN)

TRANSFORMS class-attribute instance-attribute

TRANSFORMS = ('transforms', LaminDBRegistry.TRANSFORM)

ULabelField

Bases: RegistryField

Fields of core.ulabel (LaminDBRegistry.ULABEL).

ID class-attribute instance-attribute

ID = 'id'

UID class-attribute instance-attribute

UID = 'uid'

CREATED_AT class-attribute instance-attribute

CREATED_AT = 'created_at'

DESCRIPTION class-attribute instance-attribute

DESCRIPTION = 'description'

IS_LOCKED class-attribute instance-attribute

IS_LOCKED = 'is_locked'

IS_TYPE class-attribute instance-attribute

IS_TYPE = 'is_type'

NAME class-attribute instance-attribute

NAME = 'name'

REFERENCE class-attribute instance-attribute

REFERENCE = 'reference'

REFERENCE_TYPE class-attribute instance-attribute

REFERENCE_TYPE = 'reference_type'

UPDATED_AT class-attribute instance-attribute

UPDATED_AT = 'updated_at'

BRANCH_ID class-attribute instance-attribute

BRANCH_ID = 'branch_id'

CREATED_BY_ID class-attribute instance-attribute

CREATED_BY_ID = 'created_by_id'

CREATED_ON_ID class-attribute instance-attribute

CREATED_ON_ID = 'created_on_id'

RUN_ID class-attribute instance-attribute

RUN_ID = 'run_id'

SPACE_ID class-attribute instance-attribute

SPACE_ID = 'space_id'

TYPE_ID class-attribute instance-attribute

TYPE_ID = 'type_id'

BRANCH class-attribute instance-attribute

BRANCH = ('branch', LaminDBRegistry.BRANCH)

CREATED_BY class-attribute instance-attribute

CREATED_BY = ('created_by', LaminDBRegistry.USER)

CREATED_ON class-attribute instance-attribute

CREATED_ON = ('created_on', LaminDBRegistry.BRANCH)

RUN class-attribute instance-attribute

RUN = ('run', LaminDBRegistry.RUN)

SPACE class-attribute instance-attribute

SPACE = ('space', LaminDBRegistry.SPACE)

TYPE class-attribute instance-attribute

TYPE = ('type', LaminDBRegistry.ULABEL)

ARTIFACTS class-attribute instance-attribute

ARTIFACTS = ('artifacts', LaminDBRegistry.ARTIFACT)

BRANCHES class-attribute instance-attribute

BRANCHES = ('branches', LaminDBRegistry.BRANCH)

CHILDREN class-attribute instance-attribute

CHILDREN = ('children', LaminDBRegistry.ULABEL)

COLLECTIONS class-attribute instance-attribute

COLLECTIONS = ('collections', LaminDBRegistry.COLLECTION)

LINKED_IN_RECORDS class-attribute instance-attribute

LINKED_IN_RECORDS = ('linked_in_records', LaminDBRegistry.RECORD)

PARENTS class-attribute instance-attribute

PARENTS = ('parents', LaminDBRegistry.ULABEL)

PROJECTS class-attribute instance-attribute

PROJECTS = ('projects', LaminDBRegistry.PROJECT)

RUNS class-attribute instance-attribute

RUNS = ('runs', LaminDBRegistry.RUN)

TRANSFORMS class-attribute instance-attribute

TRANSFORMS = ('transforms', LaminDBRegistry.TRANSFORM)

FeatureField

Bases: RegistryField

Fields of core.feature (LaminDBRegistry.FEATURE).

ID class-attribute instance-attribute

ID = 'id'

UID class-attribute instance-attribute

UID = 'uid'

ARRAY_RANK class-attribute instance-attribute

ARRAY_RANK = 'array_rank'

ARRAY_SHAPE class-attribute instance-attribute

ARRAY_SHAPE = 'array_shape'

ARRAY_SIZE class-attribute instance-attribute

ARRAY_SIZE = 'array_size'

COERCE class-attribute instance-attribute

COERCE = 'coerce'

CREATED_AT class-attribute instance-attribute

CREATED_AT = 'created_at'

DEFAULT_VALUE class-attribute instance-attribute

DEFAULT_VALUE = 'default_value'

DESCRIPTION class-attribute instance-attribute

DESCRIPTION = 'description'

IS_LOCKED class-attribute instance-attribute

IS_LOCKED = 'is_locked'

IS_TYPE class-attribute instance-attribute

IS_TYPE = 'is_type'

NAME class-attribute instance-attribute

NAME = 'name'

NULLABLE class-attribute instance-attribute

NULLABLE = 'nullable'

SYNONYMS class-attribute instance-attribute

SYNONYMS = 'synonyms'

UNIT class-attribute instance-attribute

UNIT = 'unit'

UPDATED_AT class-attribute instance-attribute

UPDATED_AT = 'updated_at'

BRANCH_ID class-attribute instance-attribute

BRANCH_ID = 'branch_id'

CREATED_BY_ID class-attribute instance-attribute

CREATED_BY_ID = 'created_by_id'

CREATED_ON_ID class-attribute instance-attribute

CREATED_ON_ID = 'created_on_id'

RUN_ID class-attribute instance-attribute

RUN_ID = 'run_id'

SPACE_ID class-attribute instance-attribute

SPACE_ID = 'space_id'

TYPE_ID class-attribute instance-attribute

TYPE_ID = 'type_id'

BRANCH class-attribute instance-attribute

BRANCH = ('branch', LaminDBRegistry.BRANCH)

CREATED_BY class-attribute instance-attribute

CREATED_BY = ('created_by', LaminDBRegistry.USER)

CREATED_ON class-attribute instance-attribute

CREATED_ON = ('created_on', LaminDBRegistry.BRANCH)

RUN class-attribute instance-attribute

RUN = ('run', LaminDBRegistry.RUN)

SPACE class-attribute instance-attribute

SPACE = ('space', LaminDBRegistry.SPACE)

TYPE class-attribute instance-attribute

TYPE = ('type', LaminDBRegistry.FEATURE)

PROJECTS class-attribute instance-attribute

PROJECTS = ('projects', LaminDBRegistry.PROJECT)

SCHEMAS class-attribute instance-attribute

SCHEMAS = ('schemas', LaminDBRegistry.SCHEMA)

SchemaField

Bases: RegistryField

Fields of core.schema (LaminDBRegistry.SCHEMA).

ID class-attribute instance-attribute

ID = 'id'

UID class-attribute instance-attribute

UID = 'uid'

COERCE class-attribute instance-attribute

COERCE = 'coerce'

CREATED_AT class-attribute instance-attribute

CREATED_AT = 'created_at'

DESCRIPTION class-attribute instance-attribute

DESCRIPTION = 'description'

FLEXIBLE class-attribute instance-attribute

FLEXIBLE = 'flexible'

HASH class-attribute instance-attribute

HASH = 'hash'

IS_LOCKED class-attribute instance-attribute

IS_LOCKED = 'is_locked'

IS_TYPE class-attribute instance-attribute

IS_TYPE = 'is_type'

ITYPE class-attribute instance-attribute

ITYPE = 'itype'

MAXIMAL_SET class-attribute instance-attribute

MAXIMAL_SET = 'maximal_set'

MINIMAL_SET class-attribute instance-attribute

MINIMAL_SET = 'minimal_set'

N_MEMBERS class-attribute instance-attribute

N_MEMBERS = 'n_members'

NAME class-attribute instance-attribute

NAME = 'name'

ORDERED_SET class-attribute instance-attribute

ORDERED_SET = 'ordered_set'

OTYPE class-attribute instance-attribute

OTYPE = 'otype'

SUFFIX class-attribute instance-attribute

SUFFIX = 'suffix'

UPDATED_AT class-attribute instance-attribute

UPDATED_AT = 'updated_at'

BRANCH_ID class-attribute instance-attribute

BRANCH_ID = 'branch_id'

CREATED_BY_ID class-attribute instance-attribute

CREATED_BY_ID = 'created_by_id'

CREATED_ON_ID class-attribute instance-attribute

CREATED_ON_ID = 'created_on_id'

RUN_ID class-attribute instance-attribute

RUN_ID = 'run_id'

SPACE_ID class-attribute instance-attribute

SPACE_ID = 'space_id'

TYPE_ID class-attribute instance-attribute

TYPE_ID = 'type_id'

BRANCH class-attribute instance-attribute

BRANCH = ('branch', LaminDBRegistry.BRANCH)

CREATED_BY class-attribute instance-attribute

CREATED_BY = ('created_by', LaminDBRegistry.USER)

CREATED_ON class-attribute instance-attribute

CREATED_ON = ('created_on', LaminDBRegistry.BRANCH)

RUN class-attribute instance-attribute

RUN = ('run', LaminDBRegistry.RUN)

SPACE class-attribute instance-attribute

SPACE = ('space', LaminDBRegistry.SPACE)

TYPE class-attribute instance-attribute

TYPE = ('type', LaminDBRegistry.SCHEMA)

ARTIFACTS class-attribute instance-attribute

ARTIFACTS = ('artifacts', LaminDBRegistry.ARTIFACT)

COMPONENTS class-attribute instance-attribute

COMPONENTS = ('components', LaminDBRegistry.SCHEMA)

COMPOSITES class-attribute instance-attribute

COMPOSITES = ('composites', LaminDBRegistry.SCHEMA)

FEATURES class-attribute instance-attribute

FEATURES = ('features', LaminDBRegistry.FEATURE)

PROJECTS class-attribute instance-attribute

PROJECTS = ('projects', LaminDBRegistry.PROJECT)

RECORDS class-attribute instance-attribute

RECORDS = ('records', LaminDBRegistry.RECORD)

VALIDATED_ARTIFACTS class-attribute instance-attribute

VALIDATED_ARTIFACTS = ('validated_artifacts', LaminDBRegistry.ARTIFACT)

VALIDATED_COLLECTIONS class-attribute instance-attribute

VALIDATED_COLLECTIONS = ('validated_collections', LaminDBRegistry.COLLECTION)

ProjectField

Bases: RegistryField

Fields of core.project (LaminDBRegistry.PROJECT).

ID class-attribute instance-attribute

ID = 'id'

UID class-attribute instance-attribute

UID = 'uid'

ABBR class-attribute instance-attribute

ABBR = 'abbr'

CREATED_AT class-attribute instance-attribute

CREATED_AT = 'created_at'

DESCRIPTION class-attribute instance-attribute

DESCRIPTION = 'description'

END_DATE class-attribute instance-attribute

END_DATE = 'end_date'

IS_LOCKED class-attribute instance-attribute

IS_LOCKED = 'is_locked'

IS_TYPE class-attribute instance-attribute

IS_TYPE = 'is_type'

NAME class-attribute instance-attribute

NAME = 'name'

START_DATE class-attribute instance-attribute

START_DATE = 'start_date'

UPDATED_AT class-attribute instance-attribute

UPDATED_AT = 'updated_at'

URL class-attribute instance-attribute

URL = 'url'

BRANCH_ID class-attribute instance-attribute

BRANCH_ID = 'branch_id'

CREATED_BY_ID class-attribute instance-attribute

CREATED_BY_ID = 'created_by_id'

CREATED_ON_ID class-attribute instance-attribute

CREATED_ON_ID = 'created_on_id'

RUN_ID class-attribute instance-attribute

RUN_ID = 'run_id'

SPACE_ID class-attribute instance-attribute

SPACE_ID = 'space_id'

TYPE_ID class-attribute instance-attribute

TYPE_ID = 'type_id'

BRANCH class-attribute instance-attribute

BRANCH = ('branch', LaminDBRegistry.BRANCH)

CREATED_BY class-attribute instance-attribute

CREATED_BY = ('created_by', LaminDBRegistry.USER)

CREATED_ON class-attribute instance-attribute

CREATED_ON = ('created_on', LaminDBRegistry.BRANCH)

RUN class-attribute instance-attribute

RUN = ('run', LaminDBRegistry.RUN)

SPACE class-attribute instance-attribute

SPACE = ('space', LaminDBRegistry.SPACE)

TYPE class-attribute instance-attribute

TYPE = ('type', LaminDBRegistry.PROJECT)

ARTIFACTS class-attribute instance-attribute

ARTIFACTS = ('artifacts', LaminDBRegistry.ARTIFACT)

BRANCHES class-attribute instance-attribute

BRANCHES = ('branches', LaminDBRegistry.BRANCH)

CHILDREN class-attribute instance-attribute

CHILDREN = ('children', LaminDBRegistry.PROJECT)

COLLECTIONS class-attribute instance-attribute

COLLECTIONS = ('collections', LaminDBRegistry.COLLECTION)

FEATURES class-attribute instance-attribute

FEATURES = ('features', LaminDBRegistry.FEATURE)

LINKED_IN_RECORDS class-attribute instance-attribute

LINKED_IN_RECORDS = ('linked_in_records', LaminDBRegistry.RECORD)

PARENTS class-attribute instance-attribute

PARENTS = ('parents', LaminDBRegistry.PROJECT)

PREDECESSORS class-attribute instance-attribute

PREDECESSORS = ('predecessors', LaminDBRegistry.PROJECT)

RECORDS class-attribute instance-attribute

RECORDS = ('records', LaminDBRegistry.RECORD)

REFERENCES class-attribute instance-attribute

REFERENCES = ('references', LaminDBRegistry.REFERENCE)

RUNS class-attribute instance-attribute

RUNS = ('runs', LaminDBRegistry.RUN)

SCHEMAS class-attribute instance-attribute

SCHEMAS = ('schemas', LaminDBRegistry.SCHEMA)

SUCCESSORS class-attribute instance-attribute

SUCCESSORS = ('successors', LaminDBRegistry.PROJECT)

TRANSFORMS class-attribute instance-attribute

TRANSFORMS = ('transforms', LaminDBRegistry.TRANSFORM)

ULABELS class-attribute instance-attribute

ULABELS = ('ulabels', LaminDBRegistry.ULABEL)

USERS class-attribute instance-attribute

USERS = ('users', LaminDBRegistry.USER)

ReferenceField

Bases: RegistryField

Fields of core.reference (LaminDBRegistry.REFERENCE).

ID class-attribute instance-attribute

ID = 'id'

UID class-attribute instance-attribute

UID = 'uid'

ABBR class-attribute instance-attribute

ABBR = 'abbr'

CREATED_AT class-attribute instance-attribute

CREATED_AT = 'created_at'

DATE class-attribute instance-attribute

DATE = 'date'

DESCRIPTION class-attribute instance-attribute

DESCRIPTION = 'description'

DOI class-attribute instance-attribute

DOI = 'doi'

IS_LOCKED class-attribute instance-attribute

IS_LOCKED = 'is_locked'

IS_TYPE class-attribute instance-attribute

IS_TYPE = 'is_type'

NAME class-attribute instance-attribute

NAME = 'name'

PUBMED_ID class-attribute instance-attribute

PUBMED_ID = 'pubmed_id'

TEXT class-attribute instance-attribute

TEXT = 'text'

UPDATED_AT class-attribute instance-attribute

UPDATED_AT = 'updated_at'

URL class-attribute instance-attribute

URL = 'url'

BRANCH_ID class-attribute instance-attribute

BRANCH_ID = 'branch_id'

CREATED_BY_ID class-attribute instance-attribute

CREATED_BY_ID = 'created_by_id'

CREATED_ON_ID class-attribute instance-attribute

CREATED_ON_ID = 'created_on_id'

RUN_ID class-attribute instance-attribute

RUN_ID = 'run_id'

SPACE_ID class-attribute instance-attribute

SPACE_ID = 'space_id'

TYPE_ID class-attribute instance-attribute

TYPE_ID = 'type_id'

BRANCH class-attribute instance-attribute

BRANCH = ('branch', LaminDBRegistry.BRANCH)

CREATED_BY class-attribute instance-attribute

CREATED_BY = ('created_by', LaminDBRegistry.USER)

CREATED_ON class-attribute instance-attribute

CREATED_ON = ('created_on', LaminDBRegistry.BRANCH)

RUN class-attribute instance-attribute

RUN = ('run', LaminDBRegistry.RUN)

SPACE class-attribute instance-attribute

SPACE = ('space', LaminDBRegistry.SPACE)

TYPE class-attribute instance-attribute

TYPE = ('type', LaminDBRegistry.REFERENCE)

ARTIFACTS class-attribute instance-attribute

ARTIFACTS = ('artifacts', LaminDBRegistry.ARTIFACT)

COLLECTIONS class-attribute instance-attribute

COLLECTIONS = ('collections', LaminDBRegistry.COLLECTION)

LINKED_IN_RECORDS class-attribute instance-attribute

LINKED_IN_RECORDS = ('linked_in_records', LaminDBRegistry.RECORD)

PROJECTS class-attribute instance-attribute

PROJECTS = ('projects', LaminDBRegistry.PROJECT)

RECORDS class-attribute instance-attribute

RECORDS = ('records', LaminDBRegistry.RECORD)

TRANSFORMS class-attribute instance-attribute

TRANSFORMS = ('transforms', LaminDBRegistry.TRANSFORM)

StorageField

Bases: RegistryField

Fields of core.storage (LaminDBRegistry.STORAGE).

ID class-attribute instance-attribute

ID = 'id'

UID class-attribute instance-attribute

UID = 'uid'

CREATED_AT class-attribute instance-attribute

CREATED_AT = 'created_at'

DESCRIPTION class-attribute instance-attribute

DESCRIPTION = 'description'

INSTANCE_UID class-attribute instance-attribute

INSTANCE_UID = 'instance_uid'

IS_LOCKED class-attribute instance-attribute

IS_LOCKED = 'is_locked'

REGION class-attribute instance-attribute

REGION = 'region'

ROOT class-attribute instance-attribute

ROOT = 'root'

TYPE class-attribute instance-attribute

TYPE = 'type'

UPDATED_AT class-attribute instance-attribute

UPDATED_AT = 'updated_at'

BRANCH_ID class-attribute instance-attribute

BRANCH_ID = 'branch_id'

CREATED_BY_ID class-attribute instance-attribute

CREATED_BY_ID = 'created_by_id'

CREATED_ON_ID class-attribute instance-attribute

CREATED_ON_ID = 'created_on_id'

RUN_ID class-attribute instance-attribute

RUN_ID = 'run_id'

SPACE_ID class-attribute instance-attribute

SPACE_ID = 'space_id'

BRANCH class-attribute instance-attribute

BRANCH = ('branch', LaminDBRegistry.BRANCH)

CREATED_BY class-attribute instance-attribute

CREATED_BY = ('created_by', LaminDBRegistry.USER)

CREATED_ON class-attribute instance-attribute

CREATED_ON = ('created_on', LaminDBRegistry.BRANCH)

RUN class-attribute instance-attribute

RUN = ('run', LaminDBRegistry.RUN)

SPACE class-attribute instance-attribute

SPACE = ('space', LaminDBRegistry.SPACE)

ARTIFACTS class-attribute instance-attribute

ARTIFACTS = ('artifacts', LaminDBRegistry.ARTIFACT)

BranchField

Bases: RegistryField

Fields of core.branch (LaminDBRegistry.BRANCH).

ID class-attribute instance-attribute

ID = 'id'

UID class-attribute instance-attribute

UID = 'uid'

CREATED_AT class-attribute instance-attribute

CREATED_AT = 'created_at'

DESCRIPTION class-attribute instance-attribute

DESCRIPTION = 'description'

NAME class-attribute instance-attribute

NAME = 'name'

CREATED_BY_ID class-attribute instance-attribute

CREATED_BY_ID = 'created_by_id'

SPACE_ID class-attribute instance-attribute

SPACE_ID = 'space_id'

CREATED_BY class-attribute instance-attribute

CREATED_BY = ('created_by', LaminDBRegistry.USER)

SPACE class-attribute instance-attribute

SPACE = ('space', LaminDBRegistry.SPACE)

PROJECTS class-attribute instance-attribute

PROJECTS = ('projects', LaminDBRegistry.PROJECT)

ULABELS class-attribute instance-attribute

ULABELS = ('ulabels', LaminDBRegistry.ULABEL)

USERS class-attribute instance-attribute

USERS = ('users', LaminDBRegistry.USER)

SpaceField

Bases: RegistryField

Fields of core.space (LaminDBRegistry.SPACE).

ID class-attribute instance-attribute

ID = 'id'

UID class-attribute instance-attribute

UID = 'uid'

CREATED_AT class-attribute instance-attribute

CREATED_AT = 'created_at'

DESCRIPTION class-attribute instance-attribute

DESCRIPTION = 'description'

NAME class-attribute instance-attribute

NAME = 'name'

CREATED_BY_ID class-attribute instance-attribute

CREATED_BY_ID = 'created_by_id'

CREATED_BY class-attribute instance-attribute

CREATED_BY = ('created_by', LaminDBRegistry.USER)

UserField

Bases: RegistryField

Fields of core.user (LaminDBRegistry.USER).

ID class-attribute instance-attribute

ID = 'id'

UID class-attribute instance-attribute

UID = 'uid'

CREATED_AT class-attribute instance-attribute

CREATED_AT = 'created_at'

HANDLE class-attribute instance-attribute

HANDLE = 'handle'

NAME class-attribute instance-attribute

NAME = 'name'

UPDATED_AT class-attribute instance-attribute

UPDATED_AT = 'updated_at'

ARTIFACTS class-attribute instance-attribute

ARTIFACTS = ('artifacts', LaminDBRegistry.ARTIFACT)

BRANCHES class-attribute instance-attribute

BRANCHES = ('branches', LaminDBRegistry.BRANCH)

CREATED_ARTIFACTS class-attribute instance-attribute

CREATED_ARTIFACTS = ('created_artifacts', LaminDBRegistry.ARTIFACT)

CREATED_RUNS class-attribute instance-attribute

CREATED_RUNS = ('created_runs', LaminDBRegistry.RUN)

CREATED_TRANSFORMS class-attribute instance-attribute

CREATED_TRANSFORMS = ('created_transforms', LaminDBRegistry.TRANSFORM)

LINKED_IN_RECORDS class-attribute instance-attribute

LINKED_IN_RECORDS = ('linked_in_records', LaminDBRegistry.RECORD)

PROJECTS class-attribute instance-attribute

PROJECTS = ('projects', LaminDBRegistry.PROJECT)

airflow.providers.lamindb.exceptions

LaminDBApiError

LaminDBApiError(
    message: str,
    *,
    http_status_code: int | None = None,
    detail: Any = None,
    transient: bool = False,
)

Bases: AirflowException

Raised when the LaminHub REST API returns an error or malformed response.

transient is true when the request may succeed if repeated later: network errors, rate limiting (429) and server errors (5xx).

Source code in src/airflow/providers/lamindb/exceptions.py
def __init__(
    self,
    message: str,
    *,
    http_status_code: int | None = None,
    detail: Any = None,
    transient: bool = False,
) -> None:
    super().__init__(message)
    self.http_status_code = http_status_code
    self.detail = detail
    self.transient = transient

LaminDBVersionError

Bases: AirflowFailException, ValueError

Raised for lamindb older than the provider supports; tasks fail without retries.