Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👷 Minimal docs build #128

Merged
merged 2 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

# lnschema-core: Data lineage (`yvzi`)

Read the [docs](https://lamin.ai/docs/lnschema-core).
Core schema module for tracking data lineage.

It is built with [SQLModel](https://sqlmodel.tiangolo.com/), a shallow wrapper that unifies [SQLAlchemy](https://www.sqlalchemy.org/) & [Pydantic](https://pydantic-docs.helpmanual.io/).
5 changes: 0 additions & 5 deletions docs/api.md

This file was deleted.

File renamed without changes.
25 changes: 11 additions & 14 deletions docs/guide/tables.ipynb → docs/guide/1-basic-orms.ipynb
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"id": "2ee23aa0-22e1-45ae-8fe4-392702f95de5",
"metadata": {},
"source": [
"# Tables"
]
},
{
"cell_type": "markdown",
"id": "fc3e116f",
"metadata": {},
"source": [
"For guidance on using the schema module, see the documentation of [lamindb](https://lamin.ai/docs/lamindb)."
"# Basic ORM instantiation"
]
},
{
Expand All @@ -34,15 +27,14 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "c9c47fdf",
"metadata": {
"tags": []
},
"source": [
"## Create a DObject record from fields (Not for ingesting data!)\n",
"\n",
"See [guide](https://lamin.ai/docs/db/guide/ingest) for data ingestion."
"## Create a DObject record from fields"
]
},
{
Expand Down Expand Up @@ -118,7 +110,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.9.12 ('base1')",
"display_name": "py39",
"language": "python",
"name": "python3"
},
Expand All @@ -132,7 +124,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
"version": "3.9.15"
},
"vscode": {
"interpreter": {
"hash": "61b4062b24dfb1010f420dad5aa3bd73a4d2af47d0ec44eafec465a35a9d7239"
}
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Data Validation"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For more details and information about data validation, see the documentation of [lamindb](https://lamin.ai/docs/db/guide/data-validation)."
"# Basic data validation"
]
},
{
Expand All @@ -21,14 +15,13 @@
"outputs": [],
"source": [
"import nbproject as nb\n",
"import pytest\n",
"from lnschema_core import DObject, Pipeline, Run, Storage, Usage\n",
"from lnschema_core.dev.sqlmodel import SQLModelPrefix\n",
"from lndb import settings\n",
"from sqlmodel import Session, select, Relationship, Field, ForeignKeyConstraint\n",
"from typing import Optional\n",
"from pydantic import ValidationError\n",
"\n",
"import pytest"
"from pydantic import ValidationError"
]
},
{
Expand Down Expand Up @@ -68,7 +61,7 @@
"metadata": {},
"outputs": [],
"source": [
"# complex type validation works correctly (ORM functionality is maintained)\n",
"# relationship validation works correctly (ORM functionality is maintained)\n",
"assert run.pipeline"
]
},
Expand Down Expand Up @@ -104,7 +97,6 @@
"class DObjectRel(SQLModelPrefix, table=True):\n",
" id: str = Field(primary_key=True, default=None)\n",
" dobject_id: Optional[str] = Field(foreign_key=\"core.dobject.id\", index=True)\n",
"\n",
" dobject: Optional[\"DObject\"] = Relationship()\n",
"\n",
"\n",
Expand All @@ -122,20 +114,19 @@
"class DObjectRelFK(SQLModelPrefix, table=True):\n",
" id: str = Field(primary_key=True, default=None)\n",
" dobject_id: str = Field(foreign_key=\"core.dobject.id\", index=True)\n",
"\n",
" dobject: \"DObject\" = Relationship()\n",
"\n",
"\n",
"dobject = DObject(name=\"mydobject\", source_id=\"raf\", storage_id=\"g4s\")\n",
"dobject_rel = DObjectRelFK(dobject=dobject)\n",
"\n",
"\n",
"# auto-population of required fk constraints works correctly (composite fk)\n",
"class PipelineRelFK(SQLModelPrefix, table=True):\n",
" __table_args__ = (ForeignKeyConstraint([\"pipeline_id\", \"pipeline_v\"], [\"core.pipeline.id\", \"core.pipeline.v\"]),)\n",
" id: str = Field(primary_key=True, default=None)\n",
" pipeline_id: str = Field(index=True)\n",
" pipeline_v: str = Field(index=True)\n",
"\n",
" pipeline: \"Pipeline\" = Relationship()\n",
"\n",
"\n",
Expand Down
Binary file removed docs/guide/testdb/testdb.lndb
Binary file not shown.
10 changes: 0 additions & 10 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,9 @@
:end-line: 3
```

Core schema module for tracking data lineage.

It is built with [SQLModel](https://sqlmodel.tiangolo.com/), a shallow wrapper that unifies [SQLAlchemy](https://www.sqlalchemy.org/) & [Pydantic](https://pydantic-docs.helpmanual.io/).

- [Get started](guide/get-started) or browse the [tables](https://lamin.ai/docs/db/lamindb.schema).
- See the [source code](https://github.com/laminlabs/lnschema-core) on GitHub.
- For changes, see the [changelog](changelog).

```{toctree}
:maxdepth: 1
:hidden:

guide/index
api
changelog
```