frictionlessdata / tableschema-py

A Python library for working with Table Schema.
https://frictionlessdata.io
MIT License
260 stars 41 forks source link

Use tabulator-py Stream context manager capabilities for Table.iter(). #262

Closed hjoukl closed 4 years ago

hjoukl commented 4 years ago

Overview

Instead of opening the tabulator Stream and "manually" closing it on each and every function exit point make use of its context manager capabilities.

Removes the need to define a default custom exception handler in Table.iter() that properly closes the stream so we can use helpers.default_exc_handler instead.

Tests for properly closed stream had already been added in the course of #259.

Diff looks huge due to indentation change - should probably looked at once while ignoring leading whitespace.

Best, Holger

Please preserve this line to notify @roll (lead of this repository)