whosonfirst / py-mapzen-whosonfirst-meta

Simple Python utilities for working with Who's On First meta files.
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Add more descriptive error when metafile missing because of git lfs #5

Open nvkelso opened 7 years ago

nvkelso commented 7 years ago

When the metafiles haven't been checked out and fetched via git lfs they are essentially empty files with some git lfs metadata in them, but no id column. The metafile making process errors on the id not being present. Suggest adding logic to prompt someone to check that they've done the git lfs dance and try again.

Namely:

Looks like your metafiles are bunk. Try updating them with
`git lfs fetch and `git lfs checkout` and try committing again.

The error I saw was:

INFO:root:validating /Users/nvkelso/git-repos/whosonfirst-data/data/907/215/787/907215787.geojson
INFO:root:validating /Users/nvkelso/git-repos/whosonfirst-data/data/907/215/789/907215789.geojson
INFO:root:validating /Users/nvkelso/git-repos/whosonfirst-data/data/907/215/793/907215793.geojson
INFO:root:rebuild meta file for placetype macrohood with one update
Traceback (most recent call last):
  File ".git/hooks/pre-commit", line 138, in <module>
    _modified, _created = mapzen.whosonfirst.utils.update_placetype_metafiles(meta, updated, **meta_kwargs)
  File "/Library/Python/2.7/site-packages/mapzen.whosonfirst.utils-0.385-py2.7.egg/mapzen/whosonfirst/utils/__init__.py", line 583, in update_placetype_metafiles
    mapzen.whosonfirst.meta.update_metafile(source_meta, dest_meta, to_process, **kwargs)
  File "build/bdist.macosx-10.10-intel/egg/mapzen/whosonfirst/meta/__init__.py", line 48, in update_metafile
    'PsdImagePlugin',
KeyError: 'id'
nvkelso commented 7 years ago

See also: