Commit Graph

147 Commits

Author SHA1 Message Date
Koudai Aono
a61124f774 support to create dynamodb resource by cloudformation (#2219)
* support to create dynamodb resource by cloudformation
2019-05-25 10:16:33 +01: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
Xu Liu
80c11d676c Use cast_value when comparing DynamoType 2019-04-23 11:53:00 -04: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
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
Karl Gutwin
46c0f8915f Fix flake8 failures (boo) 2018-11-09 09:32:19 -05:00
Karl Gutwin
9d190aa04e Tweak functionality and add tests 2018-11-08 13:22:24 -05:00
Karl Gutwin
ff6a57f443 Fix flake8 failures 2018-11-08 11:08:24 -05:00
Karl Gutwin
0f6086f708 Finalize implementation of DynamoDB Streams 2018-11-08 10:54:54 -05:00
Karl Gutwin
519899f74f Much of the way towards complete DynamoDB Streams implementation 2018-11-07 17:10:00 -05:00
Karl Gutwin
0b57ffe26a Add StreamSpecification to dynamodb2 package 2018-11-07 15:03:25 -05:00
Gary Donovan
81f96c4ceb Don't compare a dict_keys object to a list, since it is always False 2018-10-17 11:08:44 +11:00
Steve Pulec
a22cb410b0
Merge pull request #1872 from uncovertruth/fix/wrong_type_if_exists
Fix wrong type if exists
2018-10-15 00:38:08 -04:00
Kosei Kitahara
cf157287e7
Fix wrong type if exists 2018-10-12 16:08:05 +09:00
Kosei Kitahara
2c15d71c2c
Allow spaces to if_not_exists 2018-10-11 18:21:53 +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
8b7875ec02
Ensure that table.global_indexes and table.indexes are lists 2018-06-06 12:56:19 -04:00
Mau Zsófia Ábrahám
2e75d0219c Support dynamodb2 nested map creation to mirror actual db 2018-05-14 14:02:14 +02:00
Andrew Jefferson
bf136584a9 Put projection after filter so that filters can act on fields that ar… (#1470)
* Put projection after filter so that filters can act on fields that are not projected

* fixing whitespace
2018-03-21 09:02:31 -07:00
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
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
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
ab767416fe Completed DynamoDBv2 endpoints 2017-10-29 16:06:09 +00:00
Terry Cain
c86bece382
Added FilterExpression to dynamodb scan 2017-10-07 21:57:14 +01:00
Chris Keogh
d0f38407a1 update expression attribute test 2017-09-22 15:52:32 +12:00
Chris Keogh
87d7cacda6 Merge branch 'master' of https://github.com/spulec/moto 2017-09-22 15:44:44 +12:00
Chris Keogh
037b357029 add basic projection expressions 2017-09-22 13:12:24 +12:00
Brian Rower
c1c592609a Fix python 2.7 issue 2017-09-12 23:30:15 -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
Jack Danger
d7e64fc927 Merge pull request #1127 from brianrower/feature/add-string-set
Dynamodb2 - Allow doing an ADD update_item of a string set
2017-09-11 12:33:41 -07:00
Brian Rower
386ac94abe Allow doing an ADD update of a string set
Fix test
2017-09-11 12:07:34 -07:00
sorensolari
9070b1bf66 fix uppercase only issue in update_expression #1091 2017-08-27 13:57:16 -06:00
Jack Danger
5e9c51d839 Merge pull request #790 from tideline/master
Fixes for dynamodb2 mocking
2017-07-06 22:06:08 -07:00
Peter Gorniak
a0471b0407 add comment about splitting update expression by operator keywords 2017-06-15 15:34:58 -07:00
Greg Sterin
be07fbda52 Support Expected in dynamoDB updateItem 2017-06-09 17:34:29 -07:00
Peter Gorniak
91657a537b Merge remote-tracking branch 'spulec/master' 2017-06-02 13:38:36 -07:00
Peter Gorniak
5eb866146a add assert to catch odd numbers in operator/value parsing 2017-06-02 13:19:45 -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
Steve Pulec
6d422d1f37 Add BaseModel to all models. 2017-03-11 23:41:12 -05:00
Steve Pulec
f37bad0e00 Lints. 2017-02-23 21:37:43 -05:00
Steve Pulec
ba7223f046 Fix issue for returning dynamodb floats. Closes #812. 2017-02-08 21:06:05 -05:00
Peter Gorniak
d4a31e5e50 unit tests did not catch this, but this will not work under python 2.6 2016-12-08 14:34:21 -08:00
Peter Gorniak
3c128fdb51 correct looping through update actions, value stripping, hash key regex 2016-12-07 11:47:48 -08:00
Peter Gorniak
390bef7752 fake change to force push because github was broken 2016-12-06 16:57:36 -08:00
Peter Gorniak
98a39cf4b5 account for keys potentially being substrings of other keys (e.g. #c1 and #c10) 2016-12-06 12:14:57 -08:00
Peter Gorniak
2c50561563 fix decoding keys in query condition 2016-11-29 14:04:23 -08:00
Peter Gorniak
5a7c711a74 bring dynamodb2 update expression handling closer to spec 2016-11-25 21:07:24 -08:00
Georges Chaudy
6b74487b31 fix: dynamodb2 conditions 2016-09-23 16:14:17 +01:00
Collin RM Stocks
1b65c45b56 ALWAYS use utcnow(), never now() 2016-09-07 14:40:52 -04:00
Victor Blaga
69888c3baa update_item takes into account ExpressionAttributeNames and ExpressionAttributeValues
ExpressionAttributeNames and ExpressionAttributeValues
are no longer ignored during update_item.
2016-06-21 17:45:22 +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
Steve Pulec
fecbeb28a4 Merge pull request #567 from im-auld/query-filters-issue-164
Query filters issue 164
2016-03-28 23:52:49 -04:00
Ian Auld
d595c60ead Added support for query filtering" 2016-03-16 21:30:51 -07:00
Dmitry Zv
c52e9215b2 Fixed gen() doesn't have len() error. 2016-03-16 16:17:41 -06:00
Dmitry Zv
c2df7732e5 Added ScannedCount field to DynamoDB query response. 2016-03-16 15:53:29 -06: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
aacdde7adc When hash/range key overlap, fix query logic. 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
9400cc3ba4 Added LocalSecondaryIndexes to describe property 2016-01-14 11:30:18 -08:00
Paul Craciunoiu
f3c1e21391 Delete missing attribute results in KeyError. 2016-01-11 11:16:15 -07:00
Paul Craciunoiu
f5406ad212 Handle delete updates. 2016-01-08 17:34:53 -07:00
Paul Craciunoiu
f1099dd006 Support update_item with map and numeric types. 2016-01-08 17:33:14 -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
33f023fdaf Added comments for clarity 2015-12-31 10:46:54 -08:00
Ian Auld
a0ed89c92d Added support for partial_save on tables with a hash and range key; Issue #498 2015-12-31 10:28:06 -08:00
Paul Craciunoiu
2cea05bd19 More support for GSI
* Support query via multiple KeyConditionExpressions
* Support GSI updates via table.update()
2015-12-14 15:42:18 -07:00
Paul Craciunoiu
4fa7d6283d Add query index support. 2015-12-13 23:16:25 -07:00
Steve Pulec
705ec314a3 Cleanup different places using unix_time() 2015-11-27 14:14:40 -05:00
Steve Pulec
4aa14960d2 Add support for partial updates and SS in dynamodb. 2015-11-11 21:59:55 -05:00
Steve Pulec
ab3682a55c py3 fix. 2015-11-07 16:58:39 -05:00
Steve Pulec
8d41d0019b Add basic support for AttributeUpdates in Dynamo update_item. Closes #449. 2015-11-07 16:45:24 -05:00
Michael
31d30c8ea4 return the correct response tryin to re-create a table 2015-09-10 11:31:46 +02:00
Steve Pulec
e5caaf5913 Fix for dynamodb2 attribute response. Closes #374. 2015-07-14 21:57:14 -04:00
Steve Pulec
4faf2673e5 Better value error 2015-07-14 21:27:49 -04:00
Steve Pulec
c9db7765df Fix dynamo item not found. 2015-07-13 10:33:36 -04:00
Alan Jaffe
690402ccb3 Python 3 compatibility 2015-07-07 15:38:08 -04:00
Alan Jaffe
e3c859868c Adds the ConditionalCheckFailedException to put_item
If the Item‘s original data is inconsistent with what's in DynamoDB,
the request should fail (unless overwrite is set to True).

http://boto.readthedocs.org/en/latest/ref/dynamodb2.html#boto.dynamodb2.table.Table.put_item
2015-07-07 15:07:32 -04:00
Jeffrey Gelens
e722b67f36 Merge branch 'master' of https://github.com/spulec/moto into 0.4.1-threadsafe
* 'master' of https://github.com/spulec/moto: (25 commits)
  Add @zkourouma to authors.
  0.4.2
  Fix bug where listener certificate was not being saved correctly when creating an elb. Added test to cover that case.
  [dynamodb2] adds lookup method to Table class
  Add IAM list_groups and list_groups_for_user. Closes #343.
  Fix for deleting Route53 record sets with set identifiers. Closes #342.
  Use dummy date instead of an invalid date
  Adding support for comments on hosted zones.
  Add availability zone support to Subnets created via CloudFormation
  Make availability zone dynamic in Subnet Response templates
  Add filter "availabilityZone" to DescribeSubnets and add availability zone support too
  allow starting without reseting
  Fix bug with empty string for instance vpc_id. Closes #337.
  Fix default security group description.
  Update responses.py
  Add @mrucci to authors.
  Fix merge conflicts.
  Add support for ELB attributes.
  cast to int when doing math.
  General cleanup.
  ...
2015-05-29 11:35:14 +02:00
Zack Kourouma
f03ded7e90 [dynamodb2] adds lookup method to Table class
includes additional test coverage
2015-05-20 11:20:16 -04:00
Michael
5da5c571a9 filtering the items is needed because of defaultdict is not threadsafe and returns an empty dict which results in an exception here 2015-05-20 09:36:40 +02:00
Steve Pulec
82f19952dd Add Dynamodb2 global indexes. Closes #329. 2015-03-14 15:02:43 -04:00
Steve Pulec
c5487a4464 Add compat file for Py26 OrderedDict. 2014-11-29 22:43:30 -05: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
8bc8f09b47 Some flake8 cleanup. 2014-11-15 09:35:52 -05:00
Steve Pulec
4bfbf3bbf3 Python3 fixes for dynamodb2. 2014-10-26 21:11:03 -04: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
Jeff Gregory
76856aadc7 Query sort keying on index values and not index hashes which was causing unexpected ording results 2014-02-23 03:11:54 -08:00
creyer
48cfd19fe6 dynamodb v2 no indexes 2013-12-10 11:51:54 +02:00