Skip to content

Commit 59e0298

Browse files
author
Your Name
committed
auto-create-columns:True -> auto-create:["table", "column"]
1 parent ba9c345 commit 59e0298

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ insert_data = {
4545
"user1@slicingdice.com": {
4646
"age": 22
4747
},
48-
"auto-create-columns": True
48+
"auto-create": ["table", "column"]
4949
}
5050
client.insert(insert_data)
5151

@@ -225,7 +225,7 @@ insert_data = {
225225
"date": "2016-08-17T13:23:47+00:00"
226226
}
227227
},
228-
"auto-create-columns": True
228+
"auto-create": ["table", "column"]
229229
}
230230
print client.insert(insert_data)
231231
```

pyslicer/utils/validators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ def _has_empty_column(self):
225225
for value in self.data.values():
226226
# Value is a dictionary when it is an entity being inserted:
227227
# "my-entity": {"year": 2016}
228-
# It can also be a parameter, such as "auto-create-columns":
229-
# "auto-create-columns": true
228+
# It can also be a parameter, such as "auto-create":
229+
# "auto-create-columns": ["table", "column"]
230230
if not isinstance(
231231
value, (dict, bool)) or value is None or len(
232232
str(value)) == 0:
@@ -237,8 +237,8 @@ def _has_empty_column(self):
237237
def check_insertion_size(self):
238238
insertion_batch_size = len(self.data)
239239

240-
# auto-create-columns property should not be considered as insertion of data
241-
if "auto-create-columns" in self.data:
240+
# auto-create property should not be considered as insertion of data
241+
if "auto-create" in self.data:
242242
insertion_batch_size -= 1
243243

244244
if insertion_batch_size > MAX_INSERTION_BATCH_SIZE:

tests_and_examples/run_query_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def run_tests(self, query_type):
7575

7676
print ' Query type: {}'.format(query_type)
7777

78-
auto_create = test['insert'].get('auto-create-columns', False)
78+
auto_create = test['insert'].get('auto-create', ["table", "column"])
7979
try:
8080
if auto_create:
8181
self.get_columns_from_insertion_data(test)
@@ -163,7 +163,7 @@ def get_columns_from_insertion_data(self, test):
163163
"""
164164
print ' Auto-creating columns'
165165
for entity, data in test['insert'].items():
166-
if entity != 'auto-create-columns':
166+
if entity != 'auto-create':
167167
for column in data.keys():
168168
if column not in self.column_translation:
169169
self._append_timestamp_to_column_name(

0 commit comments

Comments
 (0)