You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
get back a dataframe of data with no exceptions
Screenshots
Seems unneeded
Systems setup:
OS: Windows 10
Python version: '3.8.12 | packaged by conda-forge | (default, Oct 12 2021, 21:22:46) [MSC v.1916 64 bit (AMD64)]'
GS-Quant version: '0.9.9'
Additional context
below is the stack trace. Didn't dig into your code fully, but seems to expect a timestamp, not a string, though does work if I pass in pd.Timestamps:
File C:\ProgramData\Miniconda3\envs\t_env\lib\site-packages\gs_quant\data\dataset.py:122, in Dataset.get_data(self, start, end, as_of, since, fields, asset_id_type, **kwargs)
100 """
101 Get data for the given range and parameters
102
(...)
117 >>> weather_data = weather.get_data(dt.date(2016, 1, 15), dt.date(2016, 1, 16), city=('Boston', 'Austin'))
118 """
120 field_names = None if fields is None else list(map(lambda f: f if isinstance(f, str) else f.value, fields))
--> 122 query = self.provider.build_query(
123 start=start,
124 end=end,
125 as_of=as_of,
126 since=since,
127 fields=field_names,
128 **kwargs
129 )
130 data = self.provider.query_data(query, self.id, asset_id_type=asset_id_type)
132 return self.provider.construct_dataframe_with_types(self.id, data)
File C:\ProgramData\Miniconda3\envs\t_env\lib\site-packages\gs_quant\api\data.py:101, in DataApi.build_query(start, end, as_of, since, restrict_fields, format, dates, **kwargs)
99 snake_case_field = inflection.underscore(field)
100 if snake_case_field in query_properties:
--> 101 setattr(query, snake_case_field, value)
102 else:
103 query.where[field] = value
File C:\ProgramData\Miniconda3\envs\t_env\lib\site-packages\gs_quant\base.py:226, in Base.setattr(self, key, value)
223 raise ValueError(f'{key} cannot be set')
225 key = snake_case_key
--> 226 value = self.__coerce_value(fld.type, value)
227 self._property_changed(key, value)
228 elif key == 'name':
File C:\ProgramData\Miniconda3\envs\t_env\lib\site-packages\gs_quant\base.py:253, in Base.__coerce_value(cls, typ, value)
251 return value.to_dict()
252 if _is_supported_generic(typ):
--> 253 return _decode_generic(typ, value, False)
254 else:
255 return value
File C:\ProgramData\Miniconda3\envs\t_env\lib\site-packages\dataclasses_json\core.py:277, in decode_generic(type, value, infer_missing)
275 res = _decode_generic(type_arg, value, infer_missing)
276 else:
--> 277 res = _support_extended_types(type_arg, value)
278 else: # Union (already decoded or unsupported 'from_json' used)
279 res = value
File C:\ProgramData\Miniconda3\envs\t_env\lib\site-packages\dataclasses_json\core.py:220, in _support_extended_types(field_type, field_value)
218 else:
219 tz = datetime.now(timezone.utc).astimezone().tzinfo
--> 220 res = datetime.fromtimestamp(field_value, tz=tz)
221 elif _issubclass_safe(field_type, Decimal):
222 res = (field_value
223 if isinstance(field_value, Decimal)
224 else Decimal(field_value))
TypeError: an integer is required (got type str)
The text was updated successfully, but these errors were encountered:
Describe the bug
Dataset.get_data
fails with stringstart_time
/end_time
To Reproduce
Expected behavior
get back a dataframe of data with no exceptions
Screenshots
Seems unneeded
Systems setup:
Additional context
below is the stack trace. Didn't dig into your code fully, but seems to expect a timestamp, not a string, though does work if I pass in
pd.Timestamp
s:The text was updated successfully, but these errors were encountered: