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

First aggregate loses datetime precision #176

Closed
ahey opened this issue Nov 13, 2023 · 3 comments
Closed

First aggregate loses datetime precision #176

ahey opened this issue Nov 13, 2023 · 3 comments
Labels
bug Something isn't working needs review

Comments

@ahey
Copy link
Contributor

ahey commented Nov 13, 2023

Describe the bug
When a first aggregate returns an attribute with type :utc_datetime_usec, precision is lost.

To Reproduce
A failing test has been created to easily demonstrate the issue.

1) test first aggregate maintains datetime precision (AshPostgres.AggregateTest)
     test/aggregate_test.exs:471
     Assertion with == failed
     code:  assert post.created_at == fetched_post.latest_comment_created_at
     left:  ~U[2023-11-13 03:46:05.332378Z]
     right: ~U[2023-11-13 03:46:05Z]
     stacktrace:
       test/aggregate_test.exs:494: (test)

The bug seems to have been introduced in ash by these changes.

Here is the most recent ash commit where the issue was not present

@ahey ahey added bug Something isn't working needs review labels Nov 13, 2023
@zachdaniel
Copy link
Contributor

Hmm...yeah this looks like an issue that needs resolving. We need to get aggregate constraints as well as types here.

@zachdaniel
Copy link
Contributor

This is fixed in 2.17

@ahey
Copy link
Contributor Author

ahey commented Nov 13, 2023

Thanks Zach!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs review
Projects
None yet
Development

No branches or pull requests

2 participants