Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Apr 18, 2020
1 parent 97eee0e commit 5ba476e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
|Build Status| |Coverage Status|

Functions for use in `Google Colaboratory <https://colab.research.google.com/notebooks/intro.ipynb>`__ notebooks.

If you are viewing this on GitHub, open the `full documentation <https://kingfisher-colab.readthedocs.io/>`__ for additional details.

.. |Build Status| image:: https://github.com/open-contracting/kingfisher-colab/workflows/CI/badge.svg
.. |Coverage Status| image:: https://coveralls.io/repos/github/open-contracting/kingfisher-colab/badge.svg?branch=master
:target: https://coveralls.io/github/open-contracting/kingfisher-colab?branch=master
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
OCDS Kingfisher Colab
=====================

.. include:: ../README.rst

.. automodule:: ocdskingfishercolab
:members:
:undoc-members:
13 changes: 6 additions & 7 deletions ocdskingfishercolab/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
"""
Functions for use in `Google Colaboratory <https://colab.research.google.com/notebooks/intro.ipynb>`__ notebooks.
To import all functions:
.. code-block:: python
from ocdskingfishercolab import (create_connection, authenticate_gspread, getResults, saveToCSV, saveToSheets,
saveStraightToSheets, downloadReleases, output_notebook, set_spreadsheet_name,
authenticate_pydrive)
from ocdskingfishercolab import (create_connection, reset_connection, authenticate_gspread, authenticate_pydrive,
set_spreadsheet_name, save_dataframe_to_sheet, download_dataframe_as_csv,
download_releases_as_package, get_dataframe_from_query, get_dataframe_from_cursor)
"""
import json
import warnings

import gspread
import pandas
Expand Down Expand Up @@ -197,7 +196,7 @@ def saveToSheets(*args, **kwargs):
save_dataframe_to_sheet(*args, **kwargs)


def saveStraightToSheets(dataframe, sheetname):
def saveStraightToSheets(*args, **kwargs):
warnings.warn('saveStraightToSheets() is deprecated. Use save_dataframe_to_sheet(..., prompt=False) instead.',
DeprecationWarning, stacklevel=2)
save_dataframe_to_sheet(*args, **kwargs, prompt=False)
Expand All @@ -218,7 +217,7 @@ def downloadReleases(*args, **kwargs):
def output_notebook(*args, **kwargs):
warnings.warn('output_notebook() is deprecated. Use get_dataframe_from_query() instead.',
DeprecationWarning, stacklevel=2)
get_dataframe_for_query(*args, **kwargs)
get_dataframe_from_query(*args, **kwargs)


def getResults(*args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ def test_output_notebook(db):

def test_output_notebook_error(db):
with pytest.raises(psycopg2.errors.SyntaxError) as excinfo:
dataframe = output_notebook('invalid')
output_notebook('invalid')

assert str(excinfo.value) == 'syntax error at or near "invalid"\nLINE 1: invalid\n ^\n'

0 comments on commit 5ba476e

Please sign in to comment.