-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pin date-time (no import of AwareDatetime) #26
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vielleicht könntest du in der Testfunktion noch n assert am Ende reinklatschen. Sowas wie assert "datetime.datetime" in str(Angebot.model_fields["angebotsdatum"].annotation)
.
Btw, wenn du einen PR reviewed haben willst, solltest du ihn nicht auf "draft" stellen :) Bzw. wenn er review-fertig ist, dann auch auf GH unten den Button anklicken, damit der nicht mehr auf "draft" steht.
src/bo4e_generator/parser.py
Outdated
@@ -52,11 +54,25 @@ class BO4EDataModel(data_model_types.data_model): # type: ignore[name-defined] | |||
setattr(_Enum, "module_path", _module_path) | |||
setattr(_Enum, "module_name", _module_name) | |||
|
|||
class BO4EDataTypeManager(data_model_types.data_type_manager): # type: ignore[name-defined] | |||
"""Override the data type manager to use create the namespace. -> ensures desired date-time type""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""Override the data type manager to use create the namespace. -> ensures desired date-time type""" | |
""" | |
Override the data type manager to prevent the code generator from using the `AwareDateTime` type | |
featured in pydantic v2. Instead, the standard datetime type will be used. | |
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.