- 
                Notifications
    
You must be signed in to change notification settings  - Fork 80
 
Epoch - unix timestamp #240
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
Conversation
using type float, format: date-time to serialize datetime.datetime
          Codecov ReportAll modified and coverable lines are covered by tests ✅ 
 Additional details and impacted files@@            Coverage Diff             @@
##              main      #240    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           11        20     +9     
  Lines          685      1085   +400     
  Branches       169       257    +88     
==========================================
+ Hits           685      1085   +400     ☔ View full report in Codecov by Sentry. 🚨 Try these New Features: 
  | 
    
tests/test_epoch.py:5: in <module>
    from pydantic_extra_types import epoch
pydantic_extra_types/epoch.py:12: in <module>
    class _Base(datetime.datetime):
pydantic_extra_types/epoch.py:27: in _Base
    cls, source: type[Any], handler: Callable[[Any], CoreSchema]
E   TypeError: 'type' object is not subscriptable
    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.
Hello @commonism Thank you for your PR 🙌🏻
I have two little comments one for the docstring & the other one for adding the JSON schema test here: https://github.com/pydantic/pydantic-extra-types/blob/main/tests/test_json_schema.py
* ♻️ Migrate Pydantic Extra Types to use uv * ♻️ Update CI workflow and Makefile to remove pyright and install extra dependencies * ♻️ Update CI workflow to use uv for installing extra dependencies and remove typecheck from pre-commit config * ✨ add new type: Epoch Unix Timestamp (#240) * ✨ Fix formatting in epoch.py log entry comment * 🎨 Add blank line for improved readability in epoch * ♻️ Refactor dependency management in pyproject.toml and Makefile; update CI workflow for improved linting and coverage * ♻️ Refactor CI workflow and dependency management; unify optional dependencies under 'all' and 'extra' * ✨ Add step to install all extra dependencies in CI workflow --------- Co-authored-by: commonism <[email protected]>
have a datatype for epoch datetimes type:integer/number with format:date-time is datetime c.f. pydantic/pydantic-extra-types#240
* v20/v3x - epoch datetime values have a datatype for epoch datetimes type:integer/number with format:date-time is datetime c.f. pydantic/pydantic-extra-types#240
using type float, format: date-time to serialize datetime.datetime
fix #238