Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
v1.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
roll committed Dec 27, 2017
1 parent a317561 commit 4c1b394
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -902,6 +902,11 @@ Under the hood `tox` uses `pytest` configured in `pytest.ini`, `coverage` and `m

Here described only breaking and the most important changes. The full changelog and documentation for all released versions could be found in nicely formatted [commit history](https://github.com/frictionlessdata/tabulator-py/commits/master).

### v1.13

New API added:
- the `skip_rows` argument now supports negative numbers to skip rows from the end

### v1.12

Updated behaviour:
Expand Down
2 changes: 1 addition & 1 deletion tabulator/VERSION
@@ -1,2 +1,2 @@
1.12.2
1.13.0

7 changes: 3 additions & 4 deletions tabulator/stream.py
Expand Up @@ -417,7 +417,7 @@ def __detect_html(self):

def __apply_processors(self, iterator):

# Builtin processor
# Base processor
def builtin_processor(extended_rows):
for row_number, headers, row in extended_rows:

Expand Down Expand Up @@ -445,6 +445,7 @@ def builtin_processor(extended_rows):

yield (row_number, headers, row)

# Skip nagative rows processor
def skip_negative_rows(extended_rows):
"""
This processor will skip rows which counts from the end, e.g.
Expand All @@ -468,13 +469,11 @@ def skip_negative_rows(extended_rows):
if i - n not in rows_to_skip:
yield row

# form a processors list
# Form a processors list
processors = [builtin_processor]

# if we have to delete some rows with negative index (counting from the end)
if [n for n in self.__skip_rows_by_numbers if n < 0]:
processors.insert(0, skip_negative_rows)

if self.__post_parse:
processors += self.__post_parse

Expand Down

0 comments on commit 4c1b394

Please sign in to comment.