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

last_modified field is losing it's timestamp in DocDB #1087

Open
dbirman opened this issue Sep 30, 2024 · 0 comments
Open

last_modified field is losing it's timestamp in DocDB #1087

dbirman opened this issue Sep 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dbirman
Copy link
Member

dbirman commented Sep 30, 2024

Describe the bug
The created and last_modified fields use datetime which doesn't require a timezone and somewhere between creation and upload to DocDB the last_modified field is losing it's timezone.

Also the comment in metadata.py about creation/last_modified matching seems to be outdated:

​    # We'll set created and last_modified defaults using the root_validator
    # to ensure they're synced on creation
    created: datetime = Field(
        default_factory=datetime.utcnow,
        title="Created",
        description="The utc date and time the data asset created.",
    )
    last_modified: datetime = Field(
        default_factory=datetime.utcnow,
        title="Last Modified",
        description="The utc date and time that the data asset was last modified.",
    )

Expected behavior
Both fields could be changed to AwareDatetimeWithDefault to enforce timezone usage and their initial value should be set at the same time (or not if that doesn't actually matter)

Blocking #1086

@jtyoung84 jtyoung84 added the bug Something isn't working label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants