Skip to content

Commit

Permalink
allow_populate_by_name
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrOertlin committed Dec 5, 2023
1 parent b88701b commit 2b8ac38
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion arnold/models/database/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ def set_id(cls, v, values: dict) -> str:
return values.get("sample_id")

class Config:
allow_population_by_field_name = True
populate_by_name = True
2 changes: 1 addition & 1 deletion arnold/models/database/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ class Step(BaseModel):
process_udfs: Optional[dict] = {}

class Config:
allow_population_by_field_name = True
populate_by_name = True
extra = Extra.allow
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ def valid_step():

@pytest.fixture(scope="function")
def valid_sample():
return Sample(sample_id="some_sample_id", _id="some_id")
return Sample(sample_id="some_sample_id", id="some_id")


@pytest.fixture(scope="function")
def valid_samples():
return [
Sample(sample_id="some_sample_id", _id="some_id").model_dump(by_alias=True),
Sample(sample_id="some_other_sample_id", _id="some_other_id").model_dump(by_alias=True),
Sample(sample_id="some_sample_id", id="some_id").model_dump(),
Sample(sample_id="some_other_sample_id", id="some_other_id").model_dump(),
]


Expand Down

0 comments on commit 2b8ac38

Please sign in to comment.