@@ -22,7 +22,7 @@ def __init__(self, version_store, observe_column='observed_dt'):
22
22
version_store : `VersionStore`
23
23
The version store that keeps the underlying data frames
24
24
observe_column : `str`
25
- Column name for the datetime index that represents the insertion time of a row of data. Unless you intent to
25
+ Column name for the datetime index that represents the insertion time of a row of data. Unless you intend to
26
26
read raw data out, this column is internal to this store.
27
27
"""
28
28
self ._store = version_store
@@ -57,7 +57,8 @@ def read(self, symbol, as_of=None, raw=False, **kwargs):
57
57
index_names = list (item .data .index .names )
58
58
index_names .remove (self .observe_column )
59
59
return BitemporalItem (symbol = symbol , library = self ._store ._arctic_lib .get_name (),
60
- data = groupby_asof (item .data , as_of = as_of , dt_col = index_names , asof_col = self .observe_column ),
60
+ data = groupby_asof (item .data , as_of = as_of , dt_col = index_names ,
61
+ asof_col = self .observe_column ),
61
62
metadata = item .metadata , last_updated = last_updated )
62
63
63
64
def update (self , symbol , data , metadata = None , upsert = True , as_of = None , ** kwargs ):
@@ -77,7 +78,8 @@ def update(self, symbol, data, metadata=None, upsert=True, as_of=None, **kwargs)
77
78
as_of : `datetime.datetime`
78
79
The "insert time". Default to datetime.now()
79
80
"""
80
- assert self .observe_column not in data
81
+ if self .observe_column in data :
82
+ raise ValueError ("Column {} is not allowed as it is being used by bitemporal store interally." .format (self .observe_column ))
81
83
local_tz = mktz ()
82
84
if not as_of :
83
85
as_of = dt .now ()
0 commit comments