Skip to content

Commit fb4baf5

Browse files
authored
Merge pull request #81 from passren/0.8.1
0.8.1 - fixed something
2 parents e35c2c2 + 6153f4d commit fb4baf5

26 files changed

Lines changed: 285 additions & 545 deletions

.github/workflows/run-test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
pip install pyparsing
4141
pip install sqlean.py
4242
- name: black
43+
if: matrix.python-version != '3.9'
4344
run: |
4445
pip install black
4546
black --check pydynamodb

pydynamodb/connection.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from .error import NotSupportedError
1111
from .util import RetryConfig, retry_api_call
1212

13-
1413
if TYPE_CHECKING:
1514
from botocore.client import BaseClient
1615

pydynamodb/sql/ddl_alter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
SSESpecification.KMSMasterKeyId $$$$$$$$
110110
TableClass STANDARD_INFREQUENT_ACCESS
111111
"""
112+
112113
import logging
113114
from .ddl_sql import DdlBase
114115
from .common import KeyWords, Tokens

pydynamodb/sql/ddl_drop.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
DROP GLOBAL TABLE Issues
1212
ReplicationGroup (us-east-1, us-west-2)
1313
"""
14+
1415
import logging
1516
from .ddl_sql import DdlBase
1617
from .common import KeyWords, Tokens

pydynamodb/sql/dml_delete.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
1414
DELETE FROM "Music" WHERE "Artist" = 'Acme Band' AND "SongTitle" = 'PartiQL Rocks' RETURNING ALL OLD *
1515
"""
16+
1617
import logging
1718
from .dml_sql import DmlBase
1819
from .common import KeyWords, Tokens

pydynamodb/sql/dml_insert.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
------------------------
1010
INSERT INTO "Music" value {'Artist' : 'Acme Band','SongTitle' : 'PartiQL Rocks'}
1111
"""
12+
1213
import logging
1314
from .dml_sql import DmlBase
1415
from .common import KeyWords, Tokens

pydynamodb/sql/dml_select.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
ConsistentRead False
3232
ReturnConsumedCapacity NONE
3333
"""
34+
3435
import logging
3536
import re
3637
from abc import ABCMeta

pydynamodb/sql/dml_sql.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,14 @@ def __escape_column(self, token: Any) -> str:
135135

136136
def __init__(self, statement: str) -> None:
137137
super().__init__(statement)
138-
self._where_conditions = []
138+
self._parsed_where_conditions = []
139139
self._limit = None
140140
self._consistent_read = False
141141
self._return_consumed_capacity = "NONE"
142142

143143
@property
144144
def where_conditions(self) -> List[Optional[str]]:
145-
return self._where_conditions
145+
return self._parsed_where_conditions
146146

147147
@property
148148
def limit(self) -> int:
@@ -166,18 +166,18 @@ def transform(self) -> Dict[str, Any]:
166166
def _construct_where_conditions(self, where_conditions: List[Any]) -> str:
167167
for condition in where_conditions:
168168
if not isinstance(condition, ParseResults):
169-
self._where_conditions.append(str(condition))
169+
self._parsed_where_conditions.append(str(condition))
170170
else:
171171
function_ = condition.get("function", None)
172172
function_with_op_ = condition.get("function_with_op", None)
173173
if function_:
174174
flatted_func_params = ",".join(condition["function_params"])
175-
self._where_conditions.append(
175+
self._parsed_where_conditions.append(
176176
"%s(%s)" % (function_, flatted_func_params)
177177
)
178178
elif function_with_op_:
179179
flatted_func_params = ",".join(condition["function_params"])
180-
self._where_conditions.append(
180+
self._parsed_where_conditions.append(
181181
"%s(%s) %s %s"
182182
% (
183183
function_with_op_,
@@ -191,7 +191,7 @@ def _construct_where_conditions(self, where_conditions: List[Any]) -> str:
191191
flatted_where = " ".join(
192192
str(c) for c in flatten_list(where_conditions_)
193193
)
194-
self._where_conditions.append(flatted_where)
194+
self._parsed_where_conditions.append(flatted_where)
195195

196196
return "WHERE %s" % " ".join(self.where_conditions)
197197

pydynamodb/sql/dml_update.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
REMOVE AwardDetail.Grammys[2]
2121
WHERE Artist='Acme Band' AND SongTitle='PartiQL Rocks'
2222
"""
23+
2324
import logging
2425
from .dml_sql import DmlBase
2526
from .json_parser import jsonArray, jsonObject

pydynamodb/sql/json_parser.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,6 @@
99
# members optional in array and object collections
1010
#
1111
# Updated 9 Aug 2016 - use more current pyparsing constructs/idioms
12-
#
13-
'''
14-
json_bnf = """
15-
object
16-
{ members }
17-
{}
18-
members
19-
string : value
20-
members , string : value
21-
array
22-
[ elements ]
23-
[]
24-
elements
25-
value
26-
elements , value
27-
value
28-
string
29-
number
30-
object
31-
array
32-
true
33-
false
34-
null
35-
"""
36-
'''
3712

3813
import pyparsing as pp
3914
from pyparsing import pyparsing_common as ppc
@@ -61,11 +36,6 @@ def make_keyword(kwd_str, kwd_value):
6136
jsonValue = pp.Forward().set_name("jsonValue")
6237

6338
jsonElements = pp.DelimitedList(jsonValue).set_name(None)
64-
# jsonArray = pp.Group(LBRACK + pp.Optional(jsonElements, []) + RBRACK)
65-
# jsonValue << (
66-
# jsonString | jsonNumber | pp.Group(jsonObject) | jsonArray | TRUE | FALSE | NULL
67-
# )
68-
# memberDef = pp.Group(jsonString + COLON + jsonValue).set_name("jsonMember")
6939

7040
jsonArray = pp.Group(
7141
LBRACK + pp.Optional(jsonElements) + RBRACK, aslist=RETURN_PYTHON_COLLECTIONS

0 commit comments

Comments
 (0)