Skip to content

Commit

Permalink
Merge pull request #1137 from centerofci/less_custom_money
Browse files Browse the repository at this point in the history
Add non-composite custom money
  • Loading branch information
silentninja committed Mar 8, 2022
2 parents 8631e1c + 1cac166 commit 0323898
Show file tree
Hide file tree
Showing 15 changed files with 595 additions and 170 deletions.
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

0 comments on commit 0323898

Please sign in to comment.