Skip to content

Commit 4bfc33a

Browse files
committed
docs: Update changelog
1 parent 907213f commit 4bfc33a

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

AUTHORS.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ agate is made by a community. The following individuals have contributed code, d
4747
* `Tim Gates <https://github.com/timgates42>`_
4848
* `castorf <https://github.com/castorf>`_
4949
* `Julien Enselme <https://github.com/Jenselme>`__
50-
50+
* `Scott Gigante <https://github.com/scottgigante>`__

CHANGELOG.rst

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
1.10.0 - April 27. 2024
22
-----------------------
33

4+
- feat: :meth:`.Table.from_csv` reads the file line by line. If ``sniff_limit=None``, it reads the file into memory once, instead of twice. If ``column_types`` is a :class:`.TypeTester`, it reads the file into memory. (#778)
45
- fix: Fix :meth:`.TableSet.print_structure` for nested tablesets. (#765)
56

67
.. code-block:: python

agate/table/__init__.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def __init__(self, rows, column_names=None, column_types=None, row_names=None, _
8282
try:
8383
first_row = rows[0]
8484
except TypeError:
85-
# it's an iterator
85+
# rows is an iterator.
8686
first_row = next(rows)
8787
rows = chain([first_row], rows)
8888
self._column_names = tuple(utils.letter_name(i) for i in range(len(first_row)))
@@ -108,8 +108,7 @@ def __init__(self, rows, column_names=None, column_types=None, row_names=None, _
108108
raise ValueError('Column types must be instances of DataType.')
109109

110110
if isinstance(column_types, TypeTester):
111-
# if rows is streaming, we must bring it in-memory
112-
# note: we could do better here.
111+
# In case rows is an iterator, in which case need to read it all into memory.
113112
rows = tuple(rows)
114113
self._column_types = column_types.run(rows, self._column_names)
115114
else:

agate/table/from_csv.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ def from_csv(cls, path, column_names=None, column_types=None, row_names=None, sk
6262
handle = f
6363

6464
if sniff_limit is None:
65-
# avoid reading the file twice
65+
# Reads to the end of the tile, but avoid reading the file twice.
6666
handle = StringIO(f.read())
6767
kwargs['dialect'] = csv.Sniffer().sniff(handle.getvalue())
6868
elif sniff_limit > 0:
69+
# Reads only the start of the file.
6970
kwargs['dialect'] = csv.Sniffer().sniff(f.read(sniff_limit))
70-
# return to the start of the file
7171
f.seek(0)
7272

7373
reader = csv.reader(handle, header=header, **kwargs)
@@ -84,7 +84,6 @@ def from_csv(cls, path, column_names=None, column_types=None, row_names=None, sk
8484
rows = itertools.islice(reader, row_limit)
8585

8686
return Table(rows, column_names, column_types, row_names=row_names)
87-
8887
finally:
8988
if close:
9089
f.close()

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
project = 'agate'
1414
copyright = '2017, Christopher Groskopf'
15-
version = '1.9.1'
15+
version = '1.10.0'
1616
release = version
1717

1818
# -- General configuration ---------------------------------------------------

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name='agate',
8-
version='1.9.1',
8+
version='1.10.0',
99
description='A data analysis library that is optimized for humans instead of machines.',
1010
long_description=long_description,
1111
long_description_content_type='text/x-rst',

0 commit comments

Comments
 (0)