Skip to content

Commit a028e1d

Browse files
committed
Merge branch 'master' into no-python-loop
2 parents bb4321c + d6b7507 commit a028e1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1939
-1436
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
.ipynb_checkpoints
2121
.tags
2222
.pytest_cache
23-
.testmondata
23+
.testmon*
24+
.vscode/
2425

2526
# Docs #
2627
########
@@ -46,6 +47,7 @@ coverage_html_report
4647
*.so
4748
.build_cache_dir
4849
MANIFEST
50+
__pycache__
4951

5052
# Python files #
5153
################
@@ -69,6 +71,7 @@ dist
6971
.coverage
7072
.testmondata
7173
.pytest_cache
74+
.nox
7275

7376
# OS generated files #
7477
######################

.readthedocs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
requirements_file: docs/requirements-docs.txt
2+
build:
3+
image: latest
4+
python:
5+
pip_install: true
6+
version: 3.6

.stickler.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@ linters:
22
flake8:
33
max-line-length: 79
44
fixer: true
5+
ignore:
6+
files:
7+
ignore:
8+
- doc/**/*.py
59
fixers:
610
enable: true

.travis.yml

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,59 @@
1-
sudo: false
2-
31
language: python
42

3+
matrix:
4+
include:
5+
- os: linux
6+
python: 2.7
7+
env: PYTHON=2.7 PANDAS=0.19.2 COVERAGE='false' LINT='true'
8+
- os: linux
9+
python: 3.5
10+
env: PYTHON=3.5 PANDAS=0.18.1 COVERAGE='true' LINT='false'
11+
- os: linux
12+
python: 3.6
13+
env: PYTHON=3.6 PANDAS=0.20.1 COVERAGE='false' LINT='false'
14+
- os: linux
15+
python: 3.6
16+
env: PYTHON=3.6 PANDAS=MASTER COVERAGE='false' LINT='true'
517
env:
6-
- PYTHON=2.7 PANDAS=0.19.2 COVERAGE='false' LINT='true'
7-
- PYTHON=3.5 PANDAS=0.18.1 COVERAGE='true' LINT='false'
8-
- PYTHON=3.6 PANDAS=0.20.1 COVERAGE='false' LINT='false'
9-
- PYTHON=3.6 PANDAS=MASTER COVERAGE='false' LINT='true'
1018

1119
before_install:
1220
- echo "before_install"
1321
- source ci/travis_process_gbq_encryption.sh
1422

1523
install:
16-
- wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
17-
- bash miniconda.sh -b -p $HOME/miniconda
18-
- export PATH="$HOME/miniconda/bin:$PATH"
19-
- hash -r
20-
- conda config --set always_yes yes --set changeps1 no
21-
- conda config --add channels pandas
22-
- conda config --add channels conda-forge
23-
- conda update -q conda
24-
- conda info -a
25-
- conda create -q -n test-environment python=$PYTHON
26-
- source activate test-environment
27-
- if [[ "$PANDAS" == "MASTER" ]]; then
28-
conda install -q numpy pytz python-dateutil;
29-
PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com";
30-
pip install --pre --upgrade --timeout=60 -f $PRE_WHEELS pandas;
24+
# Upgrade setuptools and pip to work around
25+
# https://github.com/pypa/setuptools/issues/885
26+
- pip install --upgrade setuptools
27+
- pip install --upgrade pip
28+
- REQ="ci/requirements-${PYTHON}-${PANDAS}" ;
29+
if [ -f "$REQ.pip" ]; then
30+
pip install --upgrade nox-automation ;
3131
else
32+
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
33+
bash miniconda.sh -b -p $HOME/miniconda ;
34+
export PATH="$HOME/miniconda/bin:$PATH" ;
35+
hash -r ;
36+
conda config --set always_yes yes --set changeps1 no ;
37+
conda config --add channels pandas ;
38+
conda config --add channels conda-forge ;
39+
conda update -q conda ;
40+
conda info -a ;
41+
conda create -q -n test-environment python=$PYTHON ;
42+
source activate test-environment ;
43+
conda install -q setuptools ;
3244
conda install -q pandas=$PANDAS;
33-
fi
34-
- pip install coverage pytest pytest-cov flake8 codecov
35-
- REQ="ci/requirements-${PYTHON}-${PANDAS}"
36-
- if [ -f "$REQ.pip" ]; then
37-
pip install -r "$REQ.pip";
38-
else
3945
conda install -q --file "$REQ.conda";
46+
conda list ;
47+
python setup.py install ;
4048
fi
41-
- conda list
42-
- python setup.py install
4349

4450
script:
45-
- pytest -s -v --cov=pandas_gbq --cov-report xml:/tmp/pytest-cov.xml pandas_gbq
46-
- if [[ $COVERAGE == 'true' ]]; then codecov ; fi
47-
- if [[ $LINT == 'true' ]]; then flake8 pandas_gbq -v ; fi
51+
- if [[ $PYTHON == '2.7' ]]; then nox -s test27 ; fi
52+
- if [[ $PYTHON == '3.5' ]]; then nox -s test35 ; fi
53+
- if [[ $PYTHON == '3.6' ]] && [[ "$PANDAS" == "MASTER" ]]; then nox -s test36master ; fi
54+
- REQ="ci/requirements-${PYTHON}-${PANDAS}" ;
55+
if [ -f "$REQ.conda" ]; then
56+
pytest --quiet -m 'not local_auth' -v tests ;
57+
fi
58+
- if [[ $COVERAGE == 'true' ]]; then nox -s cover ; fi
59+
- if [[ $LINT == 'true' ]]; then nox -s lint ; fi

AUTHORS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,3 @@ pandas is distributed under a 3-clause ("Simplified" or "New") BSD
5454
license. Parts of NumPy, SciPy, numpydoc, bottleneck, which all have
5555
BSD-compatible licenses, are included. Their licenses follow the pandas
5656
license.
57-

ci/requirements-3.5-0.18.1.pip

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
google-auth==1.0.2
1+
google-auth==1.4.1
22
google-auth-oauthlib==0.0.1
3-
mock
4-
google-cloud-bigquery==0.29.0
3+
google-cloud-bigquery==0.32.0

ci/requirements-3.6-0.20.1.conda

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
google-auth
22
google-auth-oauthlib
3-
mock
4-
google-cloud-bigquery
3+
google-cloud-bigquery==0.32.0
4+
pytest
5+
pytest-cov
6+
codecov
7+
coverage
8+
flake8

ci/requirements-3.6-MASTER.pip

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
google-auth
22
google-auth-oauthlib
3-
mock
4-
google-cloud-bigquery
3+
git+https://github.com/GoogleCloudPlatform/google-cloud-python.git#egg=version_subpkg&subdirectory=api_core
4+
git+https://github.com/GoogleCloudPlatform/google-cloud-python.git#egg=version_subpkg&subdirectory=core
5+
git+https://github.com/GoogleCloudPlatform/google-cloud-python.git#egg=version_subpkg&subdirectory=bigquery

docs/source/api.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
API Reference
66
*************
77

8+
.. note::
9+
10+
Only functions and classes which are members of the ``pandas_gbq`` module
11+
are considered public. Submodules and their members are considered private.
12+
813
.. autosummary::
914

1015
read_gbq

docs/source/changelog.rst

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,74 @@
11
Changelog
22
=========
33

4-
0.3.2 / [TBD]
4+
.. _changelog-0.6.0:
5+
6+
0.6.0 / 2018-08-15
7+
--------------------
8+
9+
- Warn when ``dialect`` is not passed in to ``read_gbq``. The default dialect
10+
will be changing from 'legacy' to 'standard' in a future version.
11+
(:issue:`195`)
12+
- Use general float with 15 decimal digit precision when writing to local
13+
CSV buffer in ``to_gbq``. This prevents numerical overflow in certain
14+
edge cases. (:issue:`192`)
15+
16+
.. _changelog-0.5.0:
17+
18+
0.5.0 / 2018-06-15
19+
------------------
20+
21+
- Project ID parameter is optional in ``read_gbq`` and ``to_gbq`` when it can
22+
inferred from the environment. Note: you must still pass in a project ID when
23+
using user-based authentication. (:issue:`103`)
24+
- Progress bar added for ``to_gbq``, through an optional library `tqdm` as
25+
dependency. (:issue:`162`)
26+
- Add location parameter to ``read_gbq`` and ``to_gbq`` so that pandas-gbq
27+
can work with datasets in the Tokyo region. (:issue:`177`)
28+
29+
Documentation
30+
~~~~~~~~~~~~~
31+
32+
- Add :doc:`authentication how-to guide <howto/authentication>`. (:issue:`183`)
33+
- Update :doc:`contributing` guide with new paths to tests. (:issue:`154`,
34+
:issue:`164`)
35+
36+
Internal changes
37+
~~~~~~~~~~~~~~~~
38+
39+
- Tests now use `nox` to run in multiple Python environments. (:issue:`52`)
40+
- Renamed internal modules. (:issue:`154`)
41+
- Refactored auth to an internal auth module. (:issue:`176`)
42+
- Add unit tests for ``get_credentials()``. (:issue:`184`)
43+
44+
.. _changelog-0.4.1:
45+
46+
0.4.1 / 2018-04-05
547
------------------
6-
- Fix bug with querying for an array of floats (:issue:`123`)
48+
49+
- Only show ``verbose`` deprecation warning if Pandas version does not
50+
populate it. (:issue:`157`)
51+
52+
.. _changelog-0.4.0:
53+
54+
0.4.0 / 2018-04-03
55+
------------------
56+
57+
- Fix bug in `read_gbq` when building a dataframe with integer columns
58+
on Windows. Explicitly use 64bit integers when converting from BQ types.
59+
(:issue:`119`)
60+
- Fix bug in `read_gbq` when querying for an array of floats (:issue:`123`)
61+
- Fix bug in `read_gbq` with configuration argument. Updates `read_gbq` to
62+
account for breaking change in the way ``google-cloud-python`` version
63+
0.32.0+ handles query configuration API representation. (:issue:`152`)
64+
- Fix bug in `to_gbq` where seconds were discarded in timestamp columns.
65+
(:issue:`148`)
66+
- Fix bug in `to_gbq` when supplying a user-defined schema (:issue:`150`)
67+
- **Deprecate** the ``verbose`` parameter in `read_gbq` and `to_gbq`.
68+
Messages use the logging module instead of printing progress directly to
69+
standard output. (:issue:`12`)
70+
71+
.. _changelog-0.3.1:
772

873
0.3.1 / 2018-02-13
974
------------------
@@ -13,20 +78,26 @@ Changelog
1378
- Fix an issue where a dataframe containing both integer and floating point columns could not be uploaded with ``to_gbq`` (:issue:`116`)
1479
- ``to_gbq`` now uses ``to_csv`` to avoid manually looping over rows in a dataframe (should result in faster table uploads) (:issue:`96`)
1580

81+
.. _changelog-0.3.0:
82+
1683
0.3.0 / 2018-01-03
1784
------------------
1885

1986
- Use the `google-cloud-bigquery <https://googlecloudplatform.github.io/google-cloud-python/latest/bigquery/usage.html>`__ library for API calls. The ``google-cloud-bigquery`` package is a new dependency, and dependencies on ``google-api-python-client`` and ``httplib2`` are removed. See the `installation guide <https://pandas-gbq.readthedocs.io/en/latest/install.html#dependencies>`__ for more details. (:issue:`93`)
2087
- Structs and arrays are now named properly (:issue:`23`) and BigQuery functions like ``array_agg`` no longer run into errors during type conversion (:issue:`22`).
2188
- :func:`to_gbq` now uses a load job instead of the streaming API. Remove ``StreamingInsertError`` class, as it is no longer used by :func:`to_gbq`. (:issue:`7`, :issue:`75`)
2289

90+
.. _changelog-0.2.1:
91+
2392
0.2.1 / 2017-11-27
2493
------------------
2594

2695
- :func:`read_gbq` now raises ``QueryTimeout`` if the request exceeds the ``query.timeoutMs`` value specified in the BigQuery configuration. (:issue:`76`)
2796
- Environment variable ``PANDAS_GBQ_CREDENTIALS_FILE`` can now be used to override the default location where the BigQuery user account credentials are stored. (:issue:`86`)
2897
- BigQuery user account credentials are now stored in an application-specific hidden user folder on the operating system. (:issue:`41`)
2998

99+
.. _changelog-0.2.0:
100+
30101
0.2.0 / 2017-07-24
31102
------------------
32103

@@ -36,21 +107,29 @@ Changelog
36107
- :func:`read_gbq` now has a ``auth_local_webserver`` boolean argument for controlling whether to use web server or console flow when getting user credentials. Replaces `--noauth_local_webserver` command line argument. (:issue:`35`)
37108
- :func:`read_gbq` now displays the BigQuery Job ID and standard price in verbose output. (:issue:`70` and :issue:`71`)
38109

110+
.. _changelog-0.1.6:
111+
39112
0.1.6 / 2017-05-03
40113
------------------
41114

42115
- All gbq errors will simply be subclasses of ``ValueError`` and no longer inherit from the deprecated ``PandasError``.
43116

117+
.. _changelog-0.1.4:
118+
44119
0.1.4 / 2017-03-17
45120
------------------
46121

47122
- ``InvalidIndexColumn`` will be raised instead of ``InvalidColumnOrder`` in :func:`read_gbq` when the index column specified does not exist in the BigQuery schema. (:issue:`6`)
48123

124+
.. _changelog-0.1.3:
125+
49126
0.1.3 / 2017-03-04
50127
------------------
51128

52129
- Bug with appending to a BigQuery table where fields have modes (NULLABLE,REQUIRED,REPEATED) specified. These modes were compared versus the remote schema and writing a table via :func:`to_gbq` would previously raise. (:issue:`13`)
53130

131+
.. _changelog-0.1.2:
132+
54133
0.1.2 / 2017-02-23
55134
------------------
56135

docs/source/conf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,12 @@
359359
# texinfo_no_detailmenu = False
360360

361361

362-
# Example configuration for intersphinx: refer to the Python standard library.
363-
intersphinx_mapping = {'https://docs.python.org/': None}
362+
# Configuration for intersphinx:
363+
intersphinx_mapping = {
364+
'https://docs.python.org/': None,
365+
'https://pandas.pydata.org/pandas-docs/stable/': None,
366+
'https://google-auth.readthedocs.io/en/latest/': None,
367+
}
364368

365369
extlinks = {'issue': ('https://github.com/pydata/pandas-gbq/issues/%s',
366370
'GH#'),

docs/source/contributing.rst

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,24 +250,38 @@ Running the test suite
250250
The tests can then be run directly inside your Git clone (without having to
251251
install *pandas-gbq*) by typing::
252252

253-
pytest pandas_gbq
253+
pytest tests/unit
254+
pytest tests/system.py
254255

255256
The tests suite is exhaustive and takes around 20 minutes to run. Often it is
256257
worth running only a subset of tests first around your changes before running the
257258
entire suite.
258259

259260
The easiest way to do this is with::
260261

261-
pytest pandas_gbq/path/to/test.py -k regex_matching_test_name
262+
pytest tests/path/to/test.py -k regex_matching_test_name
262263

263264
Or with one of the following constructs::
264265

265-
pytest pandas_gbq/tests/[test-module].py
266-
pytest pandas_gbq/tests/[test-module].py::[TestClass]
267-
pytest pandas_gbq/tests/[test-module].py::[TestClass]::[test_method]
266+
pytest tests/[test-module].py
267+
pytest tests/[test-module].py::[TestClass]
268+
pytest tests/[test-module].py::[TestClass]::[test_method]
268269

269270
For more, see the `pytest <http://doc.pytest.org/en/latest/>`_ documentation.
270271

272+
Testing on multiple Python versions
273+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
274+
275+
pandas-gbq uses `nox <https://nox.readthedocs.io>`__ to automate testing in
276+
multiple Python environments. First, install nox.
277+
278+
.. code-block:: shell
279+
280+
$ pip install --upgrade nox-automation
281+
282+
To run tests in all versions of Python, run `nox` from the repository's root
283+
directory.
284+
271285
.. _contributing.gbq_integration_tests:
272286

273287
Running Google BigQuery Integration Tests

0 commit comments

Comments
 (0)