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

ENH: Change how datetime works in metadata. #527

Open
1 of 3 tasks
czaloom opened this issue Apr 11, 2024 · 0 comments
Open
1 of 3 tasks

ENH: Change how datetime works in metadata. #527

czaloom opened this issue Apr 11, 2024 · 0 comments
Assignees

Comments

@czaloom
Copy link
Collaborator

czaloom commented Apr 11, 2024

Feature Type

  • Adding new functionality to valor

  • Changing existing functionality in valor

  • Removing existing functionality in valor

Problem Description

Time representations in valor mimic Python's datetime objects of datetime, date, time and timedelta.

The issue with this arises when using Valor's TypeScript client. JavaScript's built-in Date does not stratify between date, time and datetime and has no representation of timedelta. This causes problems when encoding and decoding from valor's schemas.

A value created by the python client with type date would not be accessible to the typescript client as it has not way of generating such an object when using its builtin types.

Feature Description

Consolidate valor.schemas.Date and valor.schemas.Time into valor.schemas.DateTime.

  • datetime.date and datetime.time objects will return from an api request as datetime.datetime objects.

valor.schemas.Duration which corresponds to datetime.timedelta should be removed in favor of valor.schemas.Float which will store seconds as a float.

Additional Context

No response

@czaloom czaloom self-assigned this Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant