jarondl / pygtfs

A python (2/3) library for GTFS
MIT License
63 stars 44 forks source link

Can not load the zip file #71

Closed MajesticMinhaz closed 1 year ago

MajesticMinhaz commented 1 year ago
Traceback (most recent call last):
  File "/home/mdminhaz/pycharm-community-2022.3.2/plugins/python-ce/helpers/pydev/pydevconsole.py", line 364, in runcode
    coro = func()
  File "<input>", line 1, in <module>
  File "/home/mdminhaz/PycharmProjects/gtfs-practice/venv/lib/python3.10/site-packages/pygtfs/loader.py", line 87, in append_feed
    instance = gtfs_class(feed_id=feed_id, **record._asdict())
  File "<string>", line 4, in __init__
  File "/home/mdminhaz/PycharmProjects/gtfs-practice/venv/lib64/python3.10/site-packages/sqlalchemy/orm/state.py", line 575, in _initialize_instance
    with util.safe_reraise():
  File "/home/mdminhaz/PycharmProjects/gtfs-practice/venv/lib64/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 147, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "/home/mdminhaz/PycharmProjects/gtfs-practice/venv/lib64/python3.10/site-packages/sqlalchemy/orm/state.py", line 573, in _initialize_instance
    manager.original_init(*mixed[1:], **kwargs)
  File "/home/mdminhaz/PycharmProjects/gtfs-practice/venv/lib64/python3.10/site-packages/sqlalchemy/orm/decl_base.py", line 2076, in _declarative_constructor
    setattr(self, k, kwargs[k])
  File "/home/mdminhaz/PycharmProjects/gtfs-practice/venv/lib64/python3.10/site-packages/sqlalchemy/orm/attributes.py", line 528, in __set__
    self.impl.set(
  File "/home/mdminhaz/PycharmProjects/gtfs-practice/venv/lib64/python3.10/site-packages/sqlalchemy/orm/attributes.py", line 1261, in set
    value = self.fire_replace_event(
  File "/home/mdminhaz/PycharmProjects/gtfs-practice/venv/lib64/python3.10/site-packages/sqlalchemy/orm/attributes.py", line 1276, in fire_replace_event
    value = fn(
  File "/home/mdminhaz/PycharmProjects/gtfs-practice/venv/lib64/python3.10/site-packages/sqlalchemy/orm/events.py", line 2590, in wrap
    return fn(target, *arg)
  File "/home/mdminhaz/PycharmProjects/gtfs-practice/venv/lib64/python3.10/site-packages/sqlalchemy/orm/util.py", line 322, in set_
    return validator(state.obj(), key, value)
  File "/home/mdminhaz/PycharmProjects/gtfs-practice/venv/lib/python3.10/site-packages/pygtfs/gtfs_entities.py", line 86, in is_float_none
    return float(value)
TypeError: float() argument must be a string or a real number, not 'NoneType'
InterferencePattern commented 1 year ago

Please provide some context...

  1. What is the dataset you're using?
  2. What was the code you were running?

It looks like there's a missing value in the dataset. It could be in an optional field, but we have no way to know without seeing the file.

superrache commented 1 year ago

I got the same error using Pypi package v0.1.7. However, this issue seems to have been fixed (https://github.com/jarondl/pygtfs/pull/67). Why the Pypi package is not updated?

InterferencePattern commented 1 year ago

@superrache , you're right- it looks like there hasn't been a release of pygtfs released since that PR was merged.

jarondl commented 1 year ago

0.1.9 was released to PyPI. I'm closing this.