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

GTFS: data storage issue #1761

Closed
Kernald opened this issue Apr 9, 2016 · 2 comments
Closed

GTFS: data storage issue #1761

Kernald opened this issue Apr 9, 2016 · 2 comments

Comments

@Kernald
Copy link
Contributor

Kernald commented Apr 9, 2016

Home Assistant release (hass --version):
0.17.0

Python release (python3 --version):
Python 3.5.1

Component/platform:
sensor.gtfs

Description of problem:
I have an issue while importing Tisseo GTFS data. While in hass's source code, I can see this: wheelchair_boarding = Column(Integer, nullable=True), importing this row fails:

1 record read for <class 'pygtfs.gtfs_entities.Agency'>.
Failure while writing Stops(stop_id='1970324837184593', stop_code='', stop_name='Ecole Croix-Rouge', stop_lat='43.6052', stop_lon='1.38705', location_type='1', parent_station='', wheelchair_boarding='')
16-04-09 12:49:33 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform gtfs

Due to wheelchair_boarding being empty (see the stacktrace below).

Expected:
Data should be imported without any issue.

Problem-relevant configuration.yaml entries and steps to reproduce:

sensor:
  platform: gtfs
  origin: 3377699720881415
  destination: 3377699720888536
  data: tisseo_gtfs.zip
  1. Download GTFS data linked above
  2. Add the GTFS component
  3. Start hass

Traceback (if applicable):

Traceback (most recent call last):
  File "/home/kernald/home-assistant/homeassistant/helpers/entity_component.py", line 91, in _setup_platform
    discovery_info)
  File "/home/kernald/home-assistant/homeassistant/components/sensor/gtfs.py", line 157, in setup_platform
    config["origin"], config["destination"]))
  File "/home/kernald/home-assistant/homeassistant/components/sensor/gtfs.py", line 176, in __init__
    self.update()
  File "/home/kernald/home-assistant/homeassistant/components/sensor/gtfs.py", line 215, in update
    self._data_source))
  File "/home/kernald/.homeassistant/lib/pygtfs/loader.py", line 87, in append_feed
    instance = gtfs_class(feed_id=feed_id, **records_as_dict)
  File "<string>", line 4, in __init__
  File "/home/kernald/.homeassistant/lib/sqlalchemy/orm/state.py", line 306, in _initialize_instance
    manager.dispatch.init_failure(self, args, kwargs)
  File "/home/kernald/.homeassistant/lib/sqlalchemy/util/langhelpers.py", line 60, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/home/kernald/.homeassistant/lib/sqlalchemy/util/compat.py", line 184, in reraise
    raise value
  File "/home/kernald/.homeassistant/lib/sqlalchemy/orm/state.py", line 303, in _initialize_instance
    return manager.original_init(*mixed[1:], **kwargs)
  File "/home/kernald/.homeassistant/lib/sqlalchemy/ext/declarative/base.py", line 649, in _declarative_constructor
    setattr(self, k, kwargs[k])
  File "/home/kernald/.homeassistant/lib/sqlalchemy/orm/attributes.py", line 224, in __set__
    instance_dict(instance), value, None)
  File "/home/kernald/.homeassistant/lib/sqlalchemy/orm/attributes.py", line 701, in set
    value, old, initiator)
  File "/home/kernald/.homeassistant/lib/sqlalchemy/orm/attributes.py", line 710, in fire_replace_event
    self._init_append_or_replace_token())
  File "/home/kernald/.homeassistant/lib/sqlalchemy/orm/util.py", line 118, in set_
    return validator(state.obj(), key, value)
  File "/home/kernald/.homeassistant/lib/pygtfs/gtfs_entities.py", line 57, in in_range
    raise ValueError("Empty value not allowed in {0}".format(key))
ValueError: Empty value not allowed in wheelchair_boarding

Additional info:
I'm not sure of it being a data formatting issue or a hass's GTFS component configuration issue. I'll report it upstream if it ends up not being an issue with hass's component.

@robbiet480
Copy link
Member

@Kernald It appears that this is an issue with the upstream module we use for GTFS parsing, pyGTFS. I would suggest opening an issue with that project, as they have previously made provider specific fixes.

@Kernald
Copy link
Contributor Author

Kernald commented Apr 12, 2016

Alright, I reported it upstream.

@balloob balloob closed this as completed Apr 12, 2016
robbiet480 added a commit to robbiet480/home-assistant that referenced this issue Apr 12, 2016
@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants