Commit Graph

223 Commits

Author SHA1 Message Date
Kiyonori Matsumoto
7ee35a8510 fix: raises ValueError on conditional and operator
if lhs evaluates to false, rhs must be ignored, but rhs was evaluated then ValueError is occurred.
2019-09-16 23:33:52 +09:00
Julian Graham
f4df7a48ee Prevent overlapping expr name prefixes from corrupting projection expr
h/t @beheh. This patch handles the case when ProjectionExpression looks
like "#1, ..., #10" - the previous code used `replace`, which would make
the resulting projection into "foo, ..., foo0".
2019-09-09 19:08:16 -04:00
Bert Blommers
956592d615 2380 - Validate parameter-list for duplicates in dynamodb.batch_get_item 2019-08-22 16:12:48 +01:00
PND
a2aefc49b4 Fixed update_item of DynamoDB to deal with the list type. 2019-07-22 01:42:20 +09:00
Garrett Heel
0093a7992f dynamodb2: Defer evaluation of the OR RHS in condition expr 2019-07-11 08:29:07 -04:00
Steve Pulec
6a13d54616
Merge pull request #2266 from garrettheel/feat/dynamodb-expressions
Improve DynamoDB condition expression support
2019-07-09 18:22:55 -05:00
IVIURRAY
4ce0e6bbcb add extra test for ProjectionExpression using scan with ExpressionAttributes 2019-06-27 19:37:46 +01:00
IVIURRAY
949637a14c remove debug 2019-06-27 19:12:53 +01:00
IVIURRAY
b60097fab2 improve test case 2019-06-27 19:08:32 +01:00
Garrett Heel
467f669c1e add test for attr doesn't exist 2019-06-27 11:49:08 -04:00
Matthew Stevens
83082df4d9 Adding update_item and attribute_not_exists test 2019-06-26 23:22:07 +01:00
Matthew Stevens
8a90971ba1 Adding test cases for #1587 2019-06-26 23:20:55 +01:00
Matthew Stevens
6fd47f843f Test case for #1819 2019-06-26 23:20:55 +01:00
Matthew Stevens
57b668c832 Using Ops for dynamodb condition expressions 2019-06-26 23:20:55 +01:00
Matthew Stevens
1a2fc66f84 Adding dynamodb2 expression parser and fixing test cases 2019-06-26 23:20:16 +01:00
IVIURRAY
e50ce7287d ProjectionExpression works with table.scan() 2019-06-26 21:54:48 +01:00
Ber Zoidberg
6717cba286 test name fix 2019-06-12 08:12:15 -07:00
Ber Zoidberg
997556f7bb improve test coverage 2019-06-12 08:06:37 -07:00
Ber Zoidberg
26ae13b715 Fix copypasta error in comment 2019-06-11 22:41:56 -07:00
Ber Zoidberg
96c2506fd4 Fix DynamoDB UpdateExpression support for REMOVE on nested maps 2019-06-11 22:38:15 -07:00
Ber Zoidberg
1088c421d2 #2212 add support for delete on update_with_attribute_updates (#2213)
* add support for delete on update_with_attribute_updates
2019-05-22 10:47:02 +01:00
cm-iwata
9bf8fd3417 fix #2011 (#2012)
add support for Scan method using LSI or GSI
2019-05-21 17:45:30 +01:00
shiba24
b822db8d8c Support create_table with PAY_PER_REQUEST billing mode of DynamoDB 2019-04-30 22:36:25 +09:00
Tomoya Iwata
431269bcd0 fix #2161
mock_dynamodb2 query fails when using GSI with range key if target table has record that have no range key attribute
2019-04-19 12:23:06 +09:00
Greg Sterin
f035b9613d support a bit more of the dynamoDB ConditionExpression syntax 2019-02-14 18:10:01 -08:00
Gary Donovan
0b15bb13b6 Make EQ conditions work reliably in DynamoDB.
The AWS API represents a set object as a list of values. Internally
moto also represents a set as a list. This means that when we do value
comparisons, the order of the values can cause a set equality test to
fail.
2019-01-10 21:39:12 +11:00
Steve Pulec
d685a9f50a
Merge pull request #1892 from drewpearce/dynamodb-ne
Dynamodb ne
2018-12-28 21:23:01 -05:00
Steve Pulec
f82d4bb619
Merge pull request #1938 from kgutwin/i-1937-dynamodb2-update-attributes
Correct behavior of ReturnValues parameter to put_item and update_item
2018-12-28 20:36:00 -05:00
Karl Gutwin
2ec32c80f7 Merge in functionality from #1899 2018-11-09 13:21:38 -05:00
Karl Gutwin
770ad1db56 Correct behavior of ReturnValues parameter to put_item and update_item 2018-11-08 16:21:06 -05:00
Karl Gutwin
0b57ffe26a Add StreamSpecification to dynamodb2 package 2018-11-07 15:03:25 -05:00
Drew Pearce
544050ab27 added tests for dynamodb not equals 2018-10-23 15:37:28 -04:00
Kosei Kitahara
13c2e69932
Allow extra spaces to attribute_exists and attribute_not_exists too 2018-10-12 16:59:52 +09:00
Kosei Kitahara
2c15d71c2c
Allow spaces to if_not_exists 2018-10-11 18:21:53 +09:00
Tomoya Iwata
2fad7c7202 update dynamodb2 update_item
add empty string handle, fix(#1744)
2018-08-02 12:38:50 +09:00
Gary Donovan
802402bdba Tweak comparison to treat NULL/NOT_NULL correctly. (#1709)
The AWS documentation says that a ComparisonOperator of NULL means
the attribute should not exist, whereas NOT_NULL means that the
attribute should exist. It explicitly says that an attribute with a
value of NULL is considered to exist, which contradicts our previous
implementation. This affects both put_item and get_item in dynamodb2.

https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Condition.html
2018-07-13 10:11:10 +01:00
William Richard
014fbbb8cb
Added a test that queries an index when created via the table resource update
When you create an index via the table resource update, in python 3.6, it is saved as a `dict_value`,
which causes an error - this test replicates this bug
2018-06-06 12:51:51 -04:00
William Richard
25b5f03ea4
These tests do not use pytest 2018-06-06 12:09:09 -04:00
Mau Zsófia Ábrahám
64fc0d3556 add region for test 2018-05-14 14:16:39 +02:00
Mau Zsófia Ábrahám
2e75d0219c Support dynamodb2 nested map creation to mirror actual db 2018-05-14 14:02:14 +02:00
Steve Pulec
783504c897 We shouldnt throw a ValidationException on empty dynamodb key. Closes #1505. 2018-04-14 11:16:43 -04:00
sawandas
861c47a552
Update test cases for dynamodb contains filter 2018-04-09 13:42:50 +05:30
Terry Cain
a1f2ba21ee
Adds if_not_exists function to DynamoDB Update Expression
Fixes #1358
2017-11-26 22:29:23 +00:00
Terry Cain
2609f6cd3a
Added support for dynamo update_item on nested dicts (#1345) 2017-11-17 08:49:59 +00:00
Jack Danger
068417b1f2
Merge pull request #1334 from reinecke/fix/dynamo_projection_mutation
dynamodb2: Fix for ProjectionExpressions changing the data in storage
2017-11-12 08:05:33 -08:00
Jack Danger
123f369e6e
Merge pull request #1333 from terrycain/fix_1043
DynamoDB: Fixed requiring optional parameter
2017-11-11 14:06:51 -08:00
Eric Reinecke
64fb0207e2 dynamodb2 was evaluating ProjectionExpression on the wrong local result set 2017-11-10 21:57:16 -08:00
Eric Reinecke
06492026c3 dynamodb2 items are copied when using ProjectionExpression to avoid mutating originals 2017-11-10 21:35:01 -08:00
Terry Cain
5858289596
Fixed Bug 2017-11-10 21:07:22 +00:00
Terry Cain
884fc6f260
Adds FilterExpression to dynamodb.query (#1326)
* Added FilterExpression for dynamodb.query

* flake8

* Fixes using mutable default argument values
2017-11-08 22:53:31 +00:00
Terry Cain
5c02085d3a Fixed testcases after nonglobaling dynamo 2017-10-29 16:25:17 +00:00
Terry Cain
ab767416fe Completed DynamoDBv2 endpoints 2017-10-29 16:06:09 +00:00
Terry Cain
e9852c381b
Make improvements to filter expression, added NOT keyword 2017-10-22 23:20:00 +01:00
Terry Cain
2bb3e841d1 Fixed #1261 dynamodb FilterExpression bugs (#1262)
* Fixed #1261 dynamodb FilterExpression bugs

FilterExpression was incorrectly handling numbers, stupid typo there. Also >= <= and <> was not being parsed correctly.

* Switched up logic a bit for better end result. Fixes #1263

* Fixed another bug
2017-10-16 13:56:03 -07:00
Terry Cain
77fcafca18
Cleaned up code 2017-10-08 04:18:25 +01:00
Terry Cain
c86bece382
Added FilterExpression to dynamodb scan 2017-10-07 21:57:14 +01:00
Chris Keogh
6cf74742f8 add test for get_item return consumed capacity 2017-09-25 11:45:49 +13:00
Chris Keogh
84bd16d2a2 get_item update_item return capacity consumed correctly 2017-09-25 11:39:09 +13:00
Chris Keogh
d0f38407a1 update expression attribute test 2017-09-22 15:52:32 +12:00
Chris Keogh
8840495f77 add AttributeValueNames for basic ProjectionExpressions on query 2017-09-22 15:40:30 +12:00
Chris Keogh
037b357029 add basic projection expressions 2017-09-22 13:12:24 +12:00
Chris Keogh
51c3fec6dd fix scan return CapacityUnits 2017-09-20 13:57:26 +12:00
Terry Cain
16e0326fe7
Fixed #1162 2017-09-19 21:43:55 +01:00
Brian Rower
0097ab4c67 Improve code coverage 2017-09-12 23:41:12 -07:00
Brian Rower
6affc7a4ec Add basic support for the add operation in an update operation
Add basic delete functionality


Improve testing coverage and make behave more like actual dynamo on errors


Lint fix
2017-09-12 21:42:29 -07:00
Chris Keogh
1472d63c87 use assert_raises teat helper pattern 2017-09-13 08:30:15 +12:00
Chris Keogh
6ee204e458 fix server mode test 2017-09-12 14:55:43 +12:00
Chris Keogh
722859748e Merge branch 'master' of https://github.com/spulec/moto into add-empty-string-validation-exception 2017-09-12 10:52:46 +12:00
Chris Keogh
ed820cc80e return validation error for empty attribute 2017-09-12 09:28:36 +12:00
Brian Rower
386ac94abe Allow doing an ADD update of a string set
Fix test
2017-09-11 12:07:34 -07:00
Greg Sterin
be07fbda52 Support Expected in dynamoDB updateItem 2017-06-09 17:34:29 -07:00
Steve Pulec
15b811901b Merge pull request #925 from JackDanger/idempotent-dynamodb2-deletes
Idempotent Dynamodb2 deletes
2017-05-10 22:07:12 -04:00
Steve Pulec
0adebeed24 Merge #913. 2017-05-10 21:58:42 -04:00
Jack Danger Canty
8e3d46fb05 Deleting from an unknown table raises error
If the table exists then we deletes are idempotent
2017-05-08 17:25:59 -10:00
Jack Danger Canty
02edc6fa00 Idempotent Dynamodb2 deletes
Fixes #873
2017-05-01 12:31:31 -07:00
Ian Auld
cdc007fc63 Added test for query using an attribute that is not a range/hash key 2017-04-21 14:55:25 -07:00
Steve Pulec
f37bad0e00 Lints. 2017-02-23 21:37:43 -05:00
Steve Pulec
81836b6981 Get standalone server mode working for all tests. 2017-02-23 19:43:48 -05:00
Steve Pulec
fde721bed7 Testing new version of decorator. 2017-02-15 22:35:45 -05:00
Nuno Santos
71c1fbadbe Add DynamoDB tests for update_item() with UpdateExpression, support spaces in the UpdateExpression. (#758)
Fixes #745.
2016-11-11 17:04:14 -05:00
Nuno Santos
bfc664cca8 Add additional put_item test with an attribute_exists condition. 2016-11-04 13:29:53 +01:00
Nuno Santos
74b56faafd Attempt to parse simple ConditionExpressions in DynamoDB put_item().
Internally these get converted into simpler Expected={} parameters, so
for now only `attribute_exists` and `attribute_not_exists` are supported;
OR is also not suported since `expected` does not support it.
2016-11-04 12:37:10 +01:00
Georges Chaudy
6b74487b31 fix: dynamodb2 conditions 2016-09-23 16:14:17 +01:00
Victor Blaga
cb36a8b10f Fix dynamodb_v2 update_item tests
Update expression has the wrong syntax. Something like :bar denotes a
placeholder which has to be filled by supplying an additional
ExpressionAttributeNames
2016-06-21 17:46:37 +02:00
Steve Pulec
196e5a7d8d Fix dynamodb2 comparisons. Closes #601. 2016-05-05 23:39:14 -04:00
Steve Pulec
6803444d61 Fix Dynamodb table key name. Closes #524. 2016-05-05 22:14:23 -04:00
Ian Auld
cc1dee03f5 Reorganized tests 2016-03-16 21:32:54 -07:00
Ian Auld
56425c9479 Added tests for index comparisons 2016-03-14 09:39:03 -07:00
Brian Cavagnolo
6bab725b36 add dynamodb pagination 2016-03-01 15:00:23 -08:00
Steve Pulec
9596772546 Merge pull request #510 from pcraciunoiu/feature/dynamodb-add-value
Add value and UPDATE fixes
2016-01-17 15:40:07 -05:00
Paul Craciunoiu
4e9f4bfbbf Fix for ReturnValues. 2016-01-15 11:53:45 -07:00
Paul Craciunoiu
bdd4ae824b Support ADD for numeric values 2016-01-15 11:53:43 -07:00
Paul Craciunoiu
88cd009c4d Return Item even when item is not found. 2016-01-14 16:20:33 -07:00
Ian Auld
dd6cc305cd Updated more tests. 2016-01-14 14:51:47 -08:00
Ian Auld
06af5365ed Updated tests 2016-01-14 14:25:04 -08:00
Ian Auld
582db74dee Added test for creating a table with a local index. 2016-01-14 11:35:23 -08:00
Steve Pulec
96479bf1dc Merge pull request #505 from joshink/master
Reverse before limit
2016-01-10 00:31:13 -05:00
Joshua Inkenbrandt
72bda6d901 Don't do python 2 things in python 3 2016-01-09 18:29:21 -08:00
Joshua Inkenbrandt
33f31652ea Reverse before limit 2016-01-09 17:58:06 -08:00
Paul Craciunoiu
7a6e85517a Quick fix for test in python3.3 2016-01-08 17:46:55 -07:00
Paul Craciunoiu
f1099dd006 Support update_item with map and numeric types. 2016-01-08 17:33:14 -07:00
Paul Craciunoiu
fef748b1c1 Add test. 2016-01-08 17:28:06 -07:00
Steve Pulec
9b0bce93dc Merge pull request #499 from im-auld/partial-save-support-with-range-key
Partial save support with range key
2016-01-08 17:23:04 -05:00
Ian Auld
159e88db53 Added test for supporting partial_save 2015-12-31 10:17:08 -08:00
Paul Craciunoiu
2a367ca4bf Add boto3 GSI and query tests.
* Test query and condition ordering
* Test GSI create/update/delete
* Test throughput
2015-12-14 17:13:35 -07:00
Steve Pulec
8d41d0019b Add basic support for AttributeUpdates in Dynamo update_item. Closes #449. 2015-11-07 16:45:24 -05:00
Steve Pulec
e4408152d1 Add KeyConditionExpression to dynamo. 2015-08-01 19:32:33 -04:00
Steve Pulec
c9db7765df Fix dynamo item not found. 2015-07-13 10:33:36 -04:00
Alan Jaffe
898d200110 Add tests for ConditionalCheckFailedException 2015-07-08 11:55:12 -04:00
Zack Kourouma
f03ded7e90 [dynamodb2] adds lookup method to Table class
includes additional test coverage
2015-05-20 11:20:16 -04:00
Steve Pulec
82f19952dd Add Dynamodb2 global indexes. Closes #329. 2015-03-14 15:02:43 -04:00
Steve Pulec
e66916d5f1 Start to add basic support for dynamodb2 item updating. Closes #16. 2014-11-29 22:03:29 -05:00
Steve Pulec
06a635aeaa Remove dynamodb Py3 boto restrictions since we only test newer boto now. 2014-11-27 08:03:47 -05:00
David Baumgold
eedb4c4b73 Support Python 3 using six 2014-08-28 10:57:43 -04:00
David Baumgold
4201e6b430 from __future__ import unicode_literals 2014-08-27 11:33:55 -04:00
Steve Pulec
63799f3af8 Restrict tests to new version since we have change the behavior. 2014-07-22 21:53:54 -04:00
Steve Pulec
12d61ede41 Updating dynamodb2 tests for newer boto. 2014-07-22 21:47:56 -04:00
Jeff Gregory
9f14d13163 tests for reverse query order 2014-03-03 13:49:08 -08:00
Jeff Gregory
1e011d93d1 Test query search ordre
Test that the order comes out as expected when doing a query
2014-02-23 23:38:04 -08:00
Sorin
6277f72c07 add try catch for missing package in old boto versions 2014-01-07 12:59:36 +02:00
Sorin
637fef1302 port changes from commit/8b278eb05d8c72ab11d48bc3bddf65b3b7b08279 2014-01-07 11:17:11 +02:00
Sorin
b31c3ab8a5 use requires_boto_gte instead of removing the earlier versions 2014-01-07 10:56:51 +02:00
creyer
48cfd19fe6 dynamodb v2 no indexes 2013-12-10 11:51:54 +02:00