File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ insert_data = {
45
45
" user1@slicingdice.com" : {
46
46
" age" : 22
47
47
},
48
- " auto-create-columns " : True
48
+ " auto-create" : [ " table " , " column " ]
49
49
}
50
50
client.insert(insert_data)
51
51
@@ -225,7 +225,7 @@ insert_data = {
225
225
" date" : " 2016-08-17T13:23:47+00:00"
226
226
}
227
227
},
228
- " auto-create-columns " : True
228
+ " auto-create" : [ " table " , " column " ]
229
229
}
230
230
print client.insert(insert_data)
231
231
```
Original file line number Diff line number Diff line change @@ -225,8 +225,8 @@ def _has_empty_column(self):
225
225
for value in self .data .values ():
226
226
# Value is a dictionary when it is an entity being inserted:
227
227
# "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"]
230
230
if not isinstance (
231
231
value , (dict , bool )) or value is None or len (
232
232
str (value )) == 0 :
@@ -237,8 +237,8 @@ def _has_empty_column(self):
237
237
def check_insertion_size (self ):
238
238
insertion_batch_size = len (self .data )
239
239
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 :
242
242
insertion_batch_size -= 1
243
243
244
244
if insertion_batch_size > MAX_INSERTION_BATCH_SIZE :
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ def run_tests(self, query_type):
75
75
76
76
print ' Query type: {}' .format (query_type )
77
77
78
- auto_create = test ['insert' ].get ('auto-create-columns ' , False )
78
+ auto_create = test ['insert' ].get ('auto-create' , [ "table" , "column" ] )
79
79
try :
80
80
if auto_create :
81
81
self .get_columns_from_insertion_data (test )
@@ -163,7 +163,7 @@ def get_columns_from_insertion_data(self, test):
163
163
"""
164
164
print ' Auto-creating columns'
165
165
for entity , data in test ['insert' ].items ():
166
- if entity != 'auto-create-columns ' :
166
+ if entity != 'auto-create' :
167
167
for column in data .keys ():
168
168
if column not in self .column_translation :
169
169
self ._append_timestamp_to_column_name (
You can’t perform that action at this time.
0 commit comments