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

ValueError: day is out of range for month while importing dob violations #50

Closed
aepyornis opened this issue Dec 3, 2018 · 1 comment
Labels

Comments

@aepyornis
Copy link
Collaborator

aepyornis commented Dec 3, 2018

OrderedDict([('isndobbisviol', '129467'), ('boro', '1'), ('bin', '1014006'), ('block', '00769'), ('lot', '00068'), ('iss
uedate', '19910606'), ('violationtypecode', 'Z'), ('violationnumber', 'MTF2LE'), ('housenumber', '194'), ('street', '8 AVENUE'), ('dispositiondate', '1
9940231'), ('dispositioncomments', ''), ('devicenumber', ''), ('description', ''), ('ecbnumber', ''), ('number', 'V*060691ZMTF2LE'), ('violationcategor
y', 'V*-DOB VIOLATION - DISMISSED'), ('violationtype', 'Z-ZONING'), ('bbl', '1007690068')])
Traceback (most recent call last):
  File "/home/nycdb/.local/bin/nycdb", line 11, in <module>
    load_entry_point('nycdb==0.1.12', 'console_scripts', 'nycdb')()
  File "/home/nycdb/.local/lib/python3.6/site-packages/nycdb/cli.py", line 102, in main
    dispatch(args)
  File "/home/nycdb/.local/lib/python3.6/site-packages/nycdb/cli.py", line 93, in dispatch
    Dataset(args.load, args=args).db_import()
  File "/home/nycdb/.local/lib/python3.6/site-packages/nycdb/dataset.py", line 61, in db_import
    self.import_schema(schema)
  File "/home/nycdb/.local/lib/python3.6/site-packages/nycdb/dataset.py", line 97, in import_schema
    batch = list(itertools.islice(rows, 0, BATCH_SIZE))
  File "/home/nycdb/.local/lib/python3.6/site-packages/nycdb/typecast.py", line 144, in cast_rows
    yield self.cast_row(row)
  File "/home/nycdb/.local/lib/python3.6/site-packages/nycdb/typecast.py", line 155, in cast_row
    d[column] = self.cast[column.lower()](val)
  File "/home/nycdb/.local/lib/python3.6/site-packages/nycdb/typecast.py", line 180, in <lambda>
    d[k] = lambda x: date(x)
  File "/home/nycdb/.local/lib/python3.6/site-packages/nycdb/typecast.py", line 85, in date
    date = datetime.datetime.strptime(x, '%Y%m%d')
  File "/usr/lib/python3.6/_strptime.py", line 565, in _strptime_datetime
    tt, fraction = _strptime(data_string, format)
  File "/usr/lib/python3.6/_strptime.py", line 528, in _strptime
    datetime_date(year, 1, 1).toordinal() + 1
ValueError: day is out of range for month
@aepyornis aepyornis added the bug label Dec 3, 2018
aepyornis added a commit that referenced this issue Dec 4, 2018
+ minor refactoring of typecast.date()
@aepyornis
Copy link
Collaborator Author

resolved by a800863

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant