Skip to content

Commit 8c51e9f

Browse files
author
Adrian Teng
committed
Clean up
1 parent 32a9a77 commit 8c51e9f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

arctic/store/bitemporal_store.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(self, version_store, observe_column='observed_dt'):
2222
version_store : `VersionStore`
2323
The version store that keeps the underlying data frames
2424
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
2626
read raw data out, this column is internal to this store.
2727
"""
2828
self._store = version_store
@@ -57,7 +57,8 @@ def read(self, symbol, as_of=None, raw=False, **kwargs):
5757
index_names = list(item.data.index.names)
5858
index_names.remove(self.observe_column)
5959
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),
6162
metadata=item.metadata, last_updated=last_updated)
6263

6364
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)
7778
as_of : `datetime.datetime`
7879
The "insert time". Default to datetime.now()
7980
"""
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))
8183
local_tz = mktz()
8284
if not as_of:
8385
as_of = dt.now()

0 commit comments

Comments
 (0)