We can now implement the changes to the system one-by-one:
chapter06_001.py
through to chapter06_004.py
in sequence to make changes to the data model.chapter06_005.py
to retrieve stock quote data for the Watch List. It is worth mentioning that UPSERT is a very nice feature of Cassandra. We do not encounter a duplicate primary key while we insert the same row into a table. It simply updates the row if the row already exists or inserts the row otherwise. It makes the data manipulation logic neat and clean.chatper06_006.py
to store the alerts by scanning over the stock quote data of each stock in the Watch List.chapter06_007.py
and chapter06_008.py
to enquire alertlist
and alert_by_date
, respectively. Their sample test results are shown in the following figure: