From c06d43c50370ab0cebf27f2b9fc9fe1c627f3b85 Mon Sep 17 00:00:00 2001 From: Kori Kuzma Date: Wed, 18 Dec 2024 15:53:37 -0500 Subject: [PATCH] rm date/datetime --- src/ga4gh/core/models.py | 26 -------------------------- tests/validation/test_schemas.py | 3 ++- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/src/ga4gh/core/models.py b/src/ga4gh/core/models.py index 993b7958..00ba7a95 100644 --- a/src/ga4gh/core/models.py +++ b/src/ga4gh/core/models.py @@ -3,8 +3,6 @@ from __future__ import annotations from abc import ABC -from datetime import date as datetime_date -from datetime import datetime as datetime_datetime from enum import Enum from typing import Annotated, Any, Dict, List, Optional, Union @@ -77,30 +75,6 @@ def ga4gh_serialize(self) -> str: ) -class date(RootModel): - """A string is valid against this format if it represents a date in the following format: YYYY-MM-DD.""" - - root: datetime_date = Field( - ..., - json_schema_extra={ - "description": "A string is valid against this format if it represents a date in the following format: YYYY-MM-DD." - }, - ) - - -class datetime(RootModel): - """A string is valid against this format if it represents a date-time in the - following format: YYYY:MM::DDThh:mm:ss.sTZD. - """ - - root: datetime_datetime = Field( - ..., - json_schema_extra={ - "description": "A string is valid against this format if it represents a date-time in the following format: YYYY:MM::DDThh:mm:ss.sTZD." - }, - ) - - ######################################### # Abstract core classes ######################################### diff --git a/tests/validation/test_schemas.py b/tests/validation/test_schemas.py index 5b20f23a..58cef888 100644 --- a/tests/validation/test_schemas.py +++ b/tests/validation/test_schemas.py @@ -77,7 +77,8 @@ def test_schema_models_in_pydantic(gks_schema, pydantic_models): for schema_model in ( mapping.base_classes | mapping.concrete_classes | mapping.primitives ): - assert getattr(pydantic_models, schema_model, False), schema_model + if schema_model not in {"date", "datetime"}: # since we leverage datetime module + assert getattr(pydantic_models, schema_model, False), schema_model @pytest.mark.parametrize(