Describe the bug
When pydantic version 2.11 is used, models with empty FilePath entries trigger a validation error when testing. This error doesn't occur with pydantic version 2.9 or 2.10
To Reproduce
Steps to reproduce the behavior:
- pytest -vv tests/snappy_pipeline/workflows/test_tumor_mutational_burden.py
- The 6 tests should pass
- Upgrade pydantic to 2.11
- Repeat pytest -vv tests/snappy_pipeline/workflows/test_tumor_mutational_burden.py
- There should be 9 errors
PydanticSerializationUnexpectedValue(Expected <class 'pathlib.Path'> but got <class 'NoneType'> with value 'None' - serialized value may not be as expected.).
Expected behavior
The tests should all pass, because only the tumor mutational burden step should be assessed.
However, it makes sense that the tests fail, because the root cause is found in the logic of configuration validation.
Additional context
These errors are actually caused by failed validation of the WgsSvExportExternalConfigModel, WgsCnvExportExternalConfigModel & VariantExportExternalConfigModel.
Each of these 3 models have the configuration parameters path_refseq_ser, path_ensembl_ser & path_db as FilePath variables without default (as should be).
However, when any instance derived from BaseStep is initialised, the parent class initialization imports ConfigModel which (as I understand) populates all the steps with default values from their models.
Then, the validation fails, because although validation itself doesn't seem to be carried out, the serialisation of empty FilePath raise errors. Changing the type of offending parameters from FilePath to str avoids the error.
Describe the bug
When pydantic version 2.11 is used, models with empty
FilePathentries trigger a validation error when testing. This error doesn't occur with pydantic version 2.9 or 2.10To Reproduce
Steps to reproduce the behavior:
PydanticSerializationUnexpectedValue(Expected <class 'pathlib.Path'> but got <class 'NoneType'> with value 'None' - serialized value may not be as expected.).Expected behavior
The tests should all pass, because only the tumor mutational burden step should be assessed.
However, it makes sense that the tests fail, because the root cause is found in the logic of configuration validation.
Additional context
These errors are actually caused by failed validation of the
WgsSvExportExternalConfigModel,WgsCnvExportExternalConfigModel&VariantExportExternalConfigModel.Each of these 3 models have the configuration parameters
path_refseq_ser,path_ensembl_ser&path_dbasFilePathvariables without default (as should be).However, when any instance derived from
BaseStepis initialised, the parent class initialization importsConfigModelwhich (as I understand) populates all the steps with default values from their models.Then, the validation fails, because although validation itself doesn't seem to be carried out, the serialisation of empty
FilePathraise errors. Changing the type of offending parameters fromFilePathtostravoids the error.