Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heroku deployment failed: reason - empty database #17

Closed
mukeshmk opened this issue Jul 20, 2020 · 0 comments
Closed

heroku deployment failed: reason - empty database #17

mukeshmk opened this issue Jul 20, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@mukeshmk
Copy link
Owner

mukeshmk commented Jul 20, 2020

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]"

Possible Fix:
Stop training the model if the data frame is empty? and train later once data is available.

Other Issues to be considered:

@mukeshmk mukeshmk added the bug Something isn't working label Jul 20, 2020
@mukeshmk mukeshmk self-assigned this Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant