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

Fix handling of the Postgres money field. #14931

Merged
merged 5 commits into from
Oct 31, 2024
Merged

Fix handling of the Postgres money field. #14931

merged 5 commits into from
Oct 31, 2024

Conversation

samwho
Copy link
Collaborator

@samwho samwho commented Oct 31, 2024

Description

In #14861 I introduced a bug that broke our handling of the Postgres money field. We had no tests around this fields, so on top of fixing the bug I have also introduced new tests to prevent this happening again.

@samwho samwho requested a review from a team as a code owner October 31, 2024 14:35
@samwho samwho requested review from adrinr and removed request for a team October 31, 2024 14:35
Copy link

qa-wolf bot commented Oct 31, 2024

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

@github-actions github-actions bot added firestorm Data/Infra/Revenue Team size/s labels Oct 31, 2024
Copy link
Collaborator

@mike12345567 mike12345567 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@shogunpurple shogunpurple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@melohagan melohagan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Just wondering what would happen if you tried to update a money field with three decimal places, e.g. `"200.123" ?

@samwho
Copy link
Collaborator Author

samwho commented Oct 31, 2024

@melohagan

CleanShot 2024-10-31 at 14 41 23@2x

I'm uncertain if this is the correct behaviour or not.

@samwho samwho enabled auto-merge October 31, 2024 14:42
@melohagan
Copy link
Collaborator

@melohagan

CleanShot 2024-10-31 at 14 41 23@2x

I'm uncertain if this is the correct behaviour or not.

That looks correct to me. Yep! https://www.postgresql.org/docs/current/datatype-money.html

Basically assumes dollars or similar two decimal currency.

Copy link
Collaborator

@adrinr adrinr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💸

@samwho samwho merged commit 94de048 into master Oct 31, 2024
13 checks passed
@samwho samwho deleted the fix-money-field branch October 31, 2024 15:03
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
firestorm Data/Infra/Revenue Team size/s
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants