data-for-change / anyway

ANYWAY - Car accidents map
http://www.anyway.co.il
MIT License
77 stars 244 forks source link

[Bug] Accident record yishuvs appear with yishuv_name "לא רשום" #2687

Closed atalyaalon closed 3 months ago

atalyaalon commented 3 months ago

Describe the bug There are accident records with yishuv_name "לא רשום" and road_segment_name that exists. Also - we need to check if there are urban accidents with yishuv_name "לא רשום" I believe the reason for that is the new "cities" script that contains this record - see here.

To Reproduce Steps to reproduce the behavior: redash query

Expected behavior

  1. We don't want to have any yishuv_name "לא רשום" record. If there is no yishuv, the yishuv_name should be empty.
  2. We want to remove such records from news_flash table that were effected by this bug (I think we'll just rerun in production location script that fills the news_flash table).
ziv17 commented 3 months ago

Hi @atalyaalon , What do you think is the better solution:

  1. Remove the line with yishuv_symbol=0 from cbs_cities table?
  2. Change the line with yishuv_symbol=0 in cbs_cities to have yishuv_name=NULL, or yishuv_name=""?
  3. Change the code that loads accidents to place NULL in yishuv_symbol and yishuv_name in these situations?
atalyaalon commented 3 months ago

Good question. I think that we need to make sure yishuv_name is NULL in the DB. I think we should keep yishuv_symbol=0 since data in the accidents table is mostly raw. However, we do need to make sure the above, I think it can be in the cbs_cities table, making sure that re-loading the table preserves yishuv_name=NULL in these cases.