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

Add non-composite custom money #1137

Merged
merged 19 commits into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion db/columns/operations/infer_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
base.PostgresType.BOOLEAN.value,
base.PostgresType.DATE.value,
base.PostgresType.NUMERIC.value,
base.PostgresType.MONEY.value,
base.MathesarCustomType.MATHESAR_MONEY.value,
base.PostgresType.TIMESTAMP_WITHOUT_TIME_ZONE.value,
base.PostgresType.TIMESTAMP_WITH_TIME_ZONE.value,
# We only infer to TIME_WITHOUT_TIME_ZONE as time zones don't make much sense
Expand Down
1 change: 1 addition & 0 deletions db/tests/columns/operations/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def _check_duplicate_unique_constraint(
'INTERVAL',
'MATHESAR_TYPES.EMAIL',
'MATHESAR_TYPES.MATHESAR_MONEY',
'MATHESAR_TYPES.MULTICURRENCY_MONEY',
'MATHESAR_TYPES.URI',
'MONEY',
'NUMERIC',
Expand Down
5 changes: 2 additions & 3 deletions db/tests/tables/operations/test_infer_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
from unittest.mock import call, patch
from sqlalchemy import Column, MetaData, Table, select
from sqlalchemy import BOOLEAN, Numeric, NUMERIC, String, VARCHAR
from sqlalchemy.dialects.postgresql import MONEY

from db.columns.operations.infer_types import infer_column_type
from db.tables.operations import infer_types as infer_operations
from db.tables.operations.create import create_mathesar_table
from db.tests.types import fixtures
from db.types import email, uri, datetime
from db.types import email, uri, datetime, money


# We need to set these variables when the file loads, or pytest can't
Expand All @@ -26,7 +25,7 @@
(String, ["t", "false", "2", "0"], VARCHAR),
(String, ["a", "cat", "mat", "bat"], VARCHAR),
(String, ["2", "1", "0", "0"], NUMERIC),
(String, ["$2", "$1", "$0"], MONEY),
(String, ["$2", "$1", "$0"], money.MathesarMoney),
(
String,
["2000-01-12", "6/23/2004", "May-2007-29", "May-2007-29 00:00:00+0", "20200909"],
Expand Down
Loading