piccolo 1.17.0__py3-none-any.whl → 1.17.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- piccolo/__init__.py +1 -1
- piccolo/apps/asgi/commands/new.py +1 -1
- piccolo/apps/migrations/auto/diffable_table.py +10 -3
- {piccolo-1.17.0.dist-info → piccolo-1.17.1.dist-info}/METADATA +1 -1
- {piccolo-1.17.0.dist-info → piccolo-1.17.1.dist-info}/RECORD +11 -11
- {piccolo-1.17.0.dist-info → piccolo-1.17.1.dist-info}/WHEEL +1 -1
- tests/apps/migrations/auto/integration/test_migrations.py +19 -0
- tests/apps/migrations/auto/test_diffable_table.py +13 -0
- {piccolo-1.17.0.dist-info → piccolo-1.17.1.dist-info}/LICENSE +0 -0
- {piccolo-1.17.0.dist-info → piccolo-1.17.1.dist-info}/entry_points.txt +0 -0
- {piccolo-1.17.0.dist-info → piccolo-1.17.1.dist-info}/top_level.txt +0 -0
piccolo/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__VERSION__ = "1.17.
|
1
|
+
__VERSION__ = "1.17.1"
|
@@ -15,7 +15,7 @@ ROUTER_DEPENDENCIES = {
|
|
15
15
|
"fastapi": ["fastapi>=0.112.1"],
|
16
16
|
"blacksheep": ["blacksheep"],
|
17
17
|
"litestar": ["litestar"],
|
18
|
-
"esmerald": ["esmerald"],
|
18
|
+
"esmerald": ["esmerald==3.3.0"],
|
19
19
|
"lilya": ["lilya"],
|
20
20
|
}
|
21
21
|
ROUTERS = list(ROUTER_DEPENDENCIES.keys())
|
@@ -40,10 +40,17 @@ def compare_dicts(
|
|
40
40
|
|
41
41
|
for key, value in dict_1.items():
|
42
42
|
dict_2_value = dict_2.get(key, ...)
|
43
|
+
|
43
44
|
if (
|
44
|
-
|
45
|
-
|
46
|
-
|
45
|
+
# If the value is `...` then it means no value was found.
|
46
|
+
(dict_2_value is ...)
|
47
|
+
# We have to compare the types, because if we just use equality
|
48
|
+
# then 1.0 == 1 is True.
|
49
|
+
# See this issue:
|
50
|
+
# https://github.com/piccolo-orm/piccolo/issues/1071
|
51
|
+
or (type(value) is not type(dict_2_value))
|
52
|
+
# Finally compare the actual values.
|
53
|
+
or (dict_2_value != value)
|
47
54
|
):
|
48
55
|
output[key] = value
|
49
56
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
piccolo/__init__.py,sha256=
|
1
|
+
piccolo/__init__.py,sha256=LHM-IUVB0dp8WEkvdMoZPznVSxU-UEwiRDYV3iBGA4w,23
|
2
2
|
piccolo/custom_types.py,sha256=7HMQAze-5mieNLfbQ5QgbRQgR2abR7ol0qehv2SqROY,604
|
3
3
|
piccolo/main.py,sha256=1VsFV67FWTUikPTysp64Fmgd9QBVa_9wcwKfwj2UCEA,5117
|
4
4
|
piccolo/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -17,7 +17,7 @@ piccolo/apps/app/commands/templates/tables.py.jinja,sha256=revzdrvDDwe78VedBKz0z
|
|
17
17
|
piccolo/apps/asgi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
18
|
piccolo/apps/asgi/piccolo_app.py,sha256=7VUvqQJbB-ScO0A62S6MiJmQL9F5DS-SdlqlDLbAblE,217
|
19
19
|
piccolo/apps/asgi/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
20
|
-
piccolo/apps/asgi/commands/new.py,sha256=
|
20
|
+
piccolo/apps/asgi/commands/new.py,sha256=Y9-uw9BdrL_wY_zJhKVTNuVHIE6hDa52YcDgBBA2yII,4248
|
21
21
|
piccolo/apps/asgi/commands/templates/app/README.md.jinja,sha256=As3gNEZt9qcRmTVkjCzNtXJ8r4-3g0fCSe7Q-P39ezI,214
|
22
22
|
piccolo/apps/asgi/commands/templates/app/_blacksheep_app.py.jinja,sha256=bgAGe0a9nWk0LAqK3VNDhPcKGqg0z8V-eIX2YmMoZLk,3117
|
23
23
|
piccolo/apps/asgi/commands/templates/app/_esmerald_app.py.jinja,sha256=S-oYY6OFhwJA8PEYnrklQUkqtot3aXTmd7QGrW8Ufn4,2670
|
@@ -59,7 +59,7 @@ piccolo/apps/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
|
|
59
59
|
piccolo/apps/migrations/piccolo_app.py,sha256=1EcS2ComBPCaMCC2C3WaPR_GqLwt3XiIJNfm5D2hMgo,593
|
60
60
|
piccolo/apps/migrations/tables.py,sha256=jqBnK-Rk545v1Eu6GaLHTVz7-uwBTUnz2m58OA-mxTc,799
|
61
61
|
piccolo/apps/migrations/auto/__init__.py,sha256=eYb1rZQaalumv_bhbcEe6x3dUglmpFtw7Egg6k7597U,316
|
62
|
-
piccolo/apps/migrations/auto/diffable_table.py,sha256=
|
62
|
+
piccolo/apps/migrations/auto/diffable_table.py,sha256=1HdqGeWFUYVJ2cJg6DZWOCh67SbgCxFVc554uD7N71A,7405
|
63
63
|
piccolo/apps/migrations/auto/migration_manager.py,sha256=tyAE1Xk6Xb58igbuHw3FGHhKkVjv_Vr5qBH4AbvVb8k,35856
|
64
64
|
piccolo/apps/migrations/auto/operations.py,sha256=169IrCLR3FtTRxHsEHNg6dTG45lcEM7Aoyy3SwgX_hU,1329
|
65
65
|
piccolo/apps/migrations/auto/schema_differ.py,sha256=VA1rK-_wNSdyZZgfA3ZOlpVGJCcvLyouKtT9k2YKhiA,26266
|
@@ -211,13 +211,13 @@ tests/apps/meta/commands/test_version.py,sha256=GxBeoC6O3OGICVOWtcCdP3bZza1MR2v9
|
|
211
211
|
tests/apps/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
212
212
|
tests/apps/migrations/test_migration.py,sha256=JmPLtf2BCWX3Yofe0GQe40m8I_yWa_-3vk1lDfFDfIo,308
|
213
213
|
tests/apps/migrations/auto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
214
|
-
tests/apps/migrations/auto/test_diffable_table.py,sha256=
|
214
|
+
tests/apps/migrations/auto/test_diffable_table.py,sha256=p0cKDkfhmu96-rB9bonOlg5bmfQ7U9S2kRppOt4YxyU,3338
|
215
215
|
tests/apps/migrations/auto/test_migration_manager.py,sha256=L2raSuhZybRyK-BEh-G-nDndAgl4sLynekHQFqyrteY,35719
|
216
216
|
tests/apps/migrations/auto/test_schema_differ.py,sha256=UdsaZisA02j15wr1bXkXD6Cqu3p0A23NwFQLXsJdQL4,19391
|
217
217
|
tests/apps/migrations/auto/test_schema_snapshot.py,sha256=ZyvGZqn3N3cwd-3S-FME5AJ8buDSHesw7yPIvY6mE5k,6196
|
218
218
|
tests/apps/migrations/auto/test_serialisation.py,sha256=EFkhES1w9h51UCamWrhxs3mf4I718ggeP7Yl5J_UID4,13548
|
219
219
|
tests/apps/migrations/auto/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
220
|
-
tests/apps/migrations/auto/integration/test_migrations.py,sha256=
|
220
|
+
tests/apps/migrations/auto/integration/test_migrations.py,sha256=e4GCAfMWvo5-6EM8f-EmAiLLGR62dxCZ8Tp-0bZ_kDQ,47285
|
221
221
|
tests/apps/migrations/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
222
222
|
tests/apps/migrations/commands/test_base.py,sha256=NgHgVjNd3Hil9eODvW7Ic2D9muTa_grNaH3YpRFfR8I,1829
|
223
223
|
tests/apps/migrations/commands/test_check.py,sha256=hOX_sVk1nfCRfbQ8tJoFEUBFhih9O4QuQLHTp5TQaiY,630
|
@@ -367,9 +367,9 @@ tests/utils/test_sql_values.py,sha256=vzxRmy16FfLZPH-sAQexBvsF9MXB8n4smr14qoEOS5
|
|
367
367
|
tests/utils/test_sync.py,sha256=9ytVo56y2vPQePvTeIi9lHIouEhWJbodl1TmzkGFrSo,799
|
368
368
|
tests/utils/test_table_reflection.py,sha256=SIzuat-IpcVj1GCFyOWKShI8YkhdOPPFH7qVrvfyPNE,3794
|
369
369
|
tests/utils/test_warnings.py,sha256=NvSC_cvJ6uZcwAGf1m-hLzETXCqprXELL8zg3TNLVMw,269
|
370
|
-
piccolo-1.17.
|
371
|
-
piccolo-1.17.
|
372
|
-
piccolo-1.17.
|
373
|
-
piccolo-1.17.
|
374
|
-
piccolo-1.17.
|
375
|
-
piccolo-1.17.
|
370
|
+
piccolo-1.17.1.dist-info/LICENSE,sha256=zFIpi-16uIJ420UMIG75NU0JbDBykvrdnXcj5U_EYBI,1059
|
371
|
+
piccolo-1.17.1.dist-info/METADATA,sha256=TZvCpeVtvGuvBWlyeNvBGPXN7dFZNSrRVuvUwyCOGRs,5178
|
372
|
+
piccolo-1.17.1.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
373
|
+
piccolo-1.17.1.dist-info/entry_points.txt,sha256=SJPHET4Fi1bN5F3WqcKkv9SClK3_F1I7m4eQjk6AFh0,46
|
374
|
+
piccolo-1.17.1.dist-info/top_level.txt,sha256=-SR74VGbk43VoPy1HH-mHm97yoGukLK87HE5kdBW6qM,24
|
375
|
+
piccolo-1.17.1.dist-info/RECORD,,
|
@@ -888,6 +888,25 @@ class TestMigrations(MigrationTestCase):
|
|
888
888
|
]
|
889
889
|
)
|
890
890
|
|
891
|
+
def test_column_type_conversion_integer_float(self):
|
892
|
+
"""
|
893
|
+
Make sure conversion between ``Integer`` and ``Real`` works - related
|
894
|
+
to this bug:
|
895
|
+
|
896
|
+
https://github.com/piccolo-orm/piccolo/issues/1071
|
897
|
+
|
898
|
+
"""
|
899
|
+
self._test_migrations(
|
900
|
+
table_snapshots=[
|
901
|
+
[self.table(column)]
|
902
|
+
for column in [
|
903
|
+
Real(default=1.0),
|
904
|
+
Integer(default=1),
|
905
|
+
Real(default=1.0),
|
906
|
+
]
|
907
|
+
]
|
908
|
+
)
|
909
|
+
|
891
910
|
def test_column_type_conversion_json(self):
|
892
911
|
self._test_migrations(
|
893
912
|
table_snapshots=[
|
@@ -73,6 +73,19 @@ class TestCompareDicts(TestCase):
|
|
73
73
|
response = compare_dicts(dict_1, dict_2)
|
74
74
|
self.assertEqual(response, {"a": OnDelete.set_default})
|
75
75
|
|
76
|
+
def test_numeric_values(self):
|
77
|
+
"""
|
78
|
+
Make sure that if we have two numbers which are equal, but different
|
79
|
+
types, then they are identified as being different.
|
80
|
+
|
81
|
+
https://github.com/piccolo-orm/piccolo/issues/1071
|
82
|
+
|
83
|
+
"""
|
84
|
+
dict_1 = {"a": 1}
|
85
|
+
dict_2 = {"a": 1.0}
|
86
|
+
response = compare_dicts(dict_1, dict_2)
|
87
|
+
self.assertEqual(response, {"a": 1})
|
88
|
+
|
76
89
|
|
77
90
|
class TestDiffableTable(TestCase):
|
78
91
|
def test_subtract(self):
|
File without changes
|
File without changes
|
File without changes
|