Skip to content

Commit

Permalink
Merge pull request #11 from TransitApp/fix_empty_csv_line_loading
Browse files Browse the repository at this point in the history
Skip empty lines when loading csv files
  • Loading branch information
JMilot1 authored Oct 24, 2022
2 parents ce8c048 + 42bceb6 commit f57fac9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions gtfs_loader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ def merge_header_and_declared_fields(file_schema, header_row):

def parse_rows(gtfs, file_schema, fields, header_row, reader):
for lineno, row in enumerate(reader, 2):
if len(row) == 0:
continue # empty row, just skip it

entity = file_schema.class_def()
entity._gtfs = gtfs

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages

setup(name='py-gtfs-loader',
version='0.1.4',
version='0.1.5',
description='Load GTFS',
url='https://github.com/TransitApp/py-gtfs-loader',
author='Nicholas Paun, Jonathan Milot',
Expand Down

0 comments on commit f57fac9

Please sign in to comment.