Skip to content
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

Use datetime instead of str for all model timestamps #352

Merged
merged 4 commits into from
Mar 28, 2024

Conversation

mesozoic
Copy link
Collaborator

This branch switches Model.created_time and all timestamps in schema/webhook/comment/etc. models to use datetime.datetime instead of the str representation that comes back from the API.

The approach is a bit wonky – inspect pydantic field metadata, check types against fields and input, selectively convert data – but it works, and doesn't require us to do anything special per field except declare its type differently than what Airtable will hand back in the API.

This is certainly a breaking change, so I'd include it in a 3.0 release.

@mesozoic mesozoic added this to the 3.0 milestone Mar 17, 2024
Copy link

codecov bot commented Mar 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (eef7b6f) to head (a4da1c6).
Report is 26 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #352   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        24    -1     
  Lines         2313      2334   +21     
=========================================
+ Hits          2313      2334   +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mesozoic mesozoic merged commit 0480949 into gtalarico:main Mar 28, 2024
9 checks passed
@mesozoic mesozoic deleted the model_created_time branch March 28, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant