Heroku Deployment Failed: reason - empty database.
when the application is deployed for the first time or the started after the database is cleared, the feature to load the data and train a model is breaking as the data frame loaded is an empty one and getting Xy for the model training fails with the error.
Traceback (most recent call last):
File "app.py", line 24, in <module>
from src.api import metrics_api
File "/home/blake/code/fm-learn/src/api.py", line 22, in <module>
fml.load_data()
File "/home/blake/code/fm-learn/src/fmlearn.py", line 60, in load_data
self._X, self._y = utils.get_Xy(self._df)
File "/home/blake/code/fm-learn/src/utils/utils.py", line 60, in get_Xy
y = df[[DATASET_HASH]]
File "/home/blake/code/fm-learn/venv/lib/python3.7/site-packages/pandas/core/frame.py", line 2806, in __getitem__
indexer = self.loc._get_listlike_indexer(key, axis=1, raise_missing=True)[1]
File "/home/blake/code/fm-learn/venv/lib/python3.7/site-packages/pandas/core/indexing.py", line 1553, in _get_listlike_indexer
keyarr, indexer, o._get_axis_number(axis), raise_missing=raise_missing
File "/home/blake/code/fm-learn/venv/lib/python3.7/site-packages/pandas/core/indexing.py", line 1640, in _validate_read_indexer
raise KeyError(f"None of [{key}] are in the [{axis_name}]")
KeyError: "None of [Index(['Dataset Hash'], dtype='object')] are in the [columns]"