Skip to content

Commit

Permalink
Fix: help shouldn't just show information about the base table
Browse files Browse the repository at this point in the history
because we might have merged more information into it already
  • Loading branch information
klieret committed May 3, 2019
1 parent 8db312f commit 248a5b7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Get information about the fields in the table:

.. code:: python
ankipandas.table_help()
cards.help()
Most of this information is from the `ankidroid documentation`_.

Expand All @@ -142,4 +142,3 @@ This software is lienced under the `MIT license`_.
.. _MIT license: https://github.com/klieret/ankipandas/blob/master/LICENSE.txt

.. end-body
16 changes: 3 additions & 13 deletions ankipandas/ankidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,17 +247,7 @@ def fields_as_columns_to_flds(self, *args, **kwargs):
**kwargs
)

def help(self, columns=None):
""" Print help about all known columns in this AnkiDataFrame.
Args:
columns: Specific column you are interested in
Returns:
:class:`pandas.DataFrame` with descriptions about each column.
"""
df = convenience.table_help(table=self._anki_table, columns=columns)
def help(self, *args, **kwargs):
df = convenience.table_help(*args, **kwargs)
return df

# def write(self):
#
help.__doc__ = convenience.table_help.__doc__
4 changes: 1 addition & 3 deletions ankipandas/test/test_ankidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ def setUp(self):
def test_help(self):
notes = AnkiDF.notes(self.db_path)
hlp = notes.help()
self.assertTrue(
["notes" in tables for tables in hlp["Tables"].values]
)
# todo


if __name__ == "__main__":
Expand Down

0 comments on commit 248a5b7

Please sign in to comment.