Skip to content

Commit

Permalink
Merge branch 'main' into mc_auroc
Browse files Browse the repository at this point in the history
  • Loading branch information
nikml committed Jul 9, 2024
2 parents b441a07 + c87abfe commit 644c550
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nannyml/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ def _parse_thresholds(cls, value: Dict[str, Any]):


class Config(BaseModel):
input: Optional[InputConfig]
input: Optional[InputConfig] = None
calculators: List[CalculatorConfig]
scheduling: Optional[SchedulingConfig]
scheduling: Optional[SchedulingConfig] = None

ignore_errors: Optional[bool]
ignore_errors: Optional[bool] = None

@classmethod
@lru_cache(maxsize=1)
Expand Down
11 changes: 11 additions & 0 deletions nannyml/io/db/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from datetime import datetime
from typing import List, Optional

from pydantic import ConfigDict
from sqlmodel import Field, Relationship, SQLModel


Expand Down Expand Up @@ -42,6 +43,11 @@ class Run(SQLModel, table=True): # type: ignore[call-arg]
Stored in the ``run`` table.
"""

# Ignore clash of `model_id` field name with default protected namespace `model_`
# See: https://github.com/pydantic/pydantic/discussions/7121
# Better solution using `alias` is not possible due to SQLModel issue
model_config = ConfigDict(protected_namespaces=())

#: Foreign key in all ``metric`` tables
id: Optional[int] = Field(default=None, primary_key=True)

Expand All @@ -61,6 +67,11 @@ class Metric(SQLModel):
Base ``Metric`` definition.
"""

# Ignore clash of `model_id` field name with default protected namespace `model_`
# See: https://github.com/pydantic/pydantic/discussions/7121
# Better solution using `alias` is not possible due to SQLModel issue
model_config = ConfigDict(protected_namespaces=())

#: The technical identifier for this database row
id: Optional[int] = Field(default=None, primary_key=True)

Expand Down

0 comments on commit 644c550

Please sign in to comment.