vn.py官网
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 1
声望: 0

D:\program files\vnstudio\lib\site-packages\vnpy\database\mongodb\mongodb_database.py in save_bar_data(self, bars)
175 interval=d["interval"],
176 datetime=d["datetime"],
--> 177 ).update_one(upsert=True, **param)
178
179 # Update bar overview

D:\program files\vnstudio\lib\site-packages\mongoengine\queryset\base.py in update_one(self, upsert, write_concern, full_result, update)
633 write_concern=write_concern,
634 full_result=full_result,
--> 635
update,
636 )
637

D:\program files\vnstudio\lib\site-packages\mongoengine\queryset\base.py in update(self, upsert, multi, write_concern, read_concern, full_result, update)
552 queryset = self.clone()
553 query = queryset._query
--> 554 update = transform.update(queryset._document,
update)
555
556 # If doing an atomic upsert on an inheritable class

D:\program files\vnstudio\lib\site-packages\mongoengine\queryset\transform.py in update(_doc_cls, **update)
315 elif op in (None, "set", "push"):
316 if field.required or value is not None:
--> 317 value = field.prepare_query_value(op, value)
318 elif op in ("pushAll", "pullAll"):
319 value = [field.prepare_query_value(op, v) for v in value]

D:\program files\vnstudio\lib\site-packages\mongoengine\fields.py in prepare_query_value(self, op, value)
162 value = re.escape(value)
163 value = re.compile(regex % value, flags)
--> 164 return super().prepare_query_value(op, value)
165
166

D:\program files\vnstudio\lib\site-packages\mongoengine\base\fields.py in prepare_query_value(self, op, value)
194 """Prepare a value that is being used in a query for PyMongo."""
195 if op in UPDATE_OPERATORS:
--> 196 self.validate(value)
197 return value
198

D:\program files\vnstudio\lib\site-packages\mongoengine\fields.py in validate(self, value)
127 def validate(self, value):
128 if not isinstance(value, str):
--> 129 self.error("StringField only accepts string values")
130
131 if self.max_length is not None and len(value) > self.max_length:

D:\program files\vnstudio\lib\site-packages\mongoengine\base\fields.py in error(self, message, errors, field_name)
169 """Raise a ValidationError."""
170 field_name = field_name if field_name else self.name
--> 171 raise ValidationError(message, errors=errors, field_name=field_name)
172
173 def to_python(self, value):

ValidationError: StringField only accepts string values

Administrator
avatar
加入于:
帖子: 4469
声望: 302

转成csv再导入吧,xlsx格式的文件毕竟处理比较复杂

© 2015-2019 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3

沪公网安备 31011502017034号