Check if the entity_id is null
- Dominant language
- Jupyter Notebook
- Stars
- 201
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
I know that this maybe is silly, but if the `entity_id` is `null` `triage` fails with the following error:
```
WARNING:root:Starting train/test for 1 out of 11: train range: 2014-01-01 00:00:00 to 2014-04-01 00:00:00
WARNING:root:3 month
Traceback (most recent call last):
File "run.py", line 22, in
experiment.run()
File "/usr/local/lib/python3.6/site-packages/triage/experiments/base.py", line 334, in run
self.catwalk()
File "/usr/local/lib/python3.6/site-packages/triage/experiments/singlethreaded.py", line 88, in catwalk
train_matrix_columns=train_store.columns(),
File "/usr/local/lib/python3.6/site-packages/catwalk/predictors.py", line 253, in predict
misc_db_parameters
File "/usr/local/lib/python3.6/site-packages/retrying.py", line 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
File "/usr/local/lib/python3.6/site-packages/retrying.py", line 206, in call
return attempt.get(self._wrap_exception)
File "/usr/local/lib/python3.6/site-packages/retrying.py", line 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
File "/usr/local/lib/python3.6/site-packages/six.py", line 686, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/retrying.py", line 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
File "/usr/local/lib/python3.6/site-packages/catwalk/predictors.py", line 159, in _write_to_db
entity_id=int(entity_id),
ValueError: cannot convert float NaN to integer
```
Maybe, we should add a note in the `README` or drop those rows with a warning (or both)
Contributor guide
Research direction
Start by reproducing the failure through run.py and inspect catwalk/predictors.py at _write_to_db, where the traceback converts entity_id to int. Check the README for existing guidance on null entity_id; done means the agreed handling is documented or verified and the shown ValueError no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100