File tree Expand file tree Collapse file tree
docs/source/reference_guides Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ are welcome to also support macOS.
4545```` {confval} database_url
4646
4747pytask uses a database to keep track of tasks, products, and dependencies over runs. By
48- default, it will create an SQLITE database in the project's root directory called
48+ default, it will create an SQLite database in the project's root directory called
4949`.pytask.sqlite3`. If you want to use a different name or a different dialect
5050[supported by sqlalchemy](https://docs.sqlalchemy.org/en/latest/core/engines.html#backend-specific-urls),
5151use either {option}`pytask build --database-url` or `database_url` in the config.
@@ -54,7 +54,7 @@ use either {option}`pytask build --database-url` or `database_url` in the config
5454database_url = "sqlite:///.pytask.sqlite3"
5555```
5656
57- Relative paths for SQLITE databases are interpreted as either relative to the
57+ Relative paths for SQLite databases are interpreted as either relative to the
5858configuration file or the root directory.
5959
6060````
Original file line number Diff line number Diff line change 1313from sqlalchemy .orm import sessionmaker
1414
1515
16- __all__ = ["create_database" , "update_states_in_database" , "DatabaseSession" ]
16+ __all__ = [
17+ "create_database" ,
18+ "update_states_in_database" ,
19+ "BaseTable" ,
20+ "DatabaseSession" ,
21+ ]
1722
1823
1924DatabaseSession = sessionmaker ()
2025
2126
22- Base = declarative_base ()
27+ BaseTable = declarative_base ()
2328
2429
25- class State (Base ): # type: ignore[valid-type, misc]
30+ class State (BaseTable ): # type: ignore[valid-type, misc]
2631 """Represent the state of a node in relation to a task."""
2732
2833 __tablename__ = "state"
@@ -37,7 +42,7 @@ def create_database(url: str) -> None:
3742 """Create the database."""
3843 try :
3944 engine = create_engine (url )
40- Base .metadata .create_all (bind = engine )
45+ BaseTable .metadata .create_all (bind = engine )
4146 DatabaseSession .configure (bind = engine )
4247 except Exception :
4348 raise
Original file line number Diff line number Diff line change 1919from _pytask .config import hookimpl
2020from _pytask .console import console
2121from _pytask .console import format_task_id
22- from _pytask .database_utils import Base
22+ from _pytask .database_utils import BaseTable
2323from _pytask .database_utils import DatabaseSession
2424from _pytask .exceptions import CollectionError
2525from _pytask .exceptions import ConfigurationError
@@ -47,7 +47,7 @@ class _ExportFormats(enum.Enum):
4747 CSV = "csv"
4848
4949
50- class Runtime (Base ): # type: ignore[valid-type, misc]
50+ class Runtime (BaseTable ): # type: ignore[valid-type, misc]
5151 """Record of runtimes of tasks."""
5252
5353 __tablename__ = "runtime"
Original file line number Diff line number Diff line change 1313from _pytask .compat import import_optional_dependency
1414from _pytask .config import hookimpl
1515from _pytask .console import console
16+ from _pytask .database_utils import BaseTable
1617from _pytask .database_utils import create_database
1718from _pytask .database_utils import DatabaseSession
1819from _pytask .database_utils import State
6566
6667
6768__all__ = [
69+ "BaseTable" ,
6870 "CollectionError" ,
6971 "CollectionMetadata" ,
7072 "CollectionOutcome" ,
You can’t perform that action at this time.
0 commit comments