Skip to content

Commit

Permalink
deps: update minimum pandas to 0.21.1 (#165)
Browse files Browse the repository at this point in the history
* chore(deps): update precommit hook pycqa/flake8 to v3.9.0

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [pycqa/flake8](https://gitlab.com/pycqa/flake8) | repository | minor | `3.8.4` -> `3.9.0` |

---

### Release Notes

<details>
<summary>pycqa/flake8</summary>

### [`v3.9.0`](https://gitlab.com/pycqa/flake8/compare/3.8.4...3.9.0)

[Compare Source](https://gitlab.com/pycqa/flake8/compare/3.8.4...3.9.0)

</details>

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/synthtool).

Source-Author: WhiteSource Renovate <bot@renovateapp.com>
Source-Date: Tue Mar 23 17:38:03 2021 +0100
Source-Repo: googleapis/synthtool
Source-Sha: f5c5904fb0c6aa3b3730eadf4e5a4485afc65726
Source-Link: googleapis/synthtool@f5c5904

* test(python): use constraints files to check dependency lower bounds

Use a constraints file when installing dependencies for system and unit tests nox sessions.

https://pip.pypa.io/en/stable/user_guide/#constraints-files
> Constraints files are requirements files that **only control which version of a requirement is installed, not whether it is installed or not**. Their syntax and contents is nearly identical to Requirements Files. There is one key difference: Including a package in a constraints file does not trigger installation of the package.

```
testing
├── constraints-3.10.txt
├── constraints-3.11.txt
├── constraints-3.6.txt
├── constraints-3.7.txt
├── constraints-3.8.txt
└── constraints-3.9.txt
```

Going forward, one constraints file (currently 3.6) will be populated with every library requirement and extra listed in the `setup.py`. The constraints file will pin each requirement to the lower bound. This ensures that library maintainers will see test failures if they forget to update a lower bound on a dependency.

See googleapis/python-bigquery#263 for an example

Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
Source-Date: Tue Mar 23 10:52:02 2021 -0600
Source-Repo: googleapis/synthtool
Source-Sha: 86ed43d4f56e6404d068e62e497029018879c771
Source-Link: googleapis/synthtool@86ed43d

* bump minimum pandas

* update minimum pandas

* use recommended way to localize timestamps in tests

Co-authored-by: Tim Swast <swast@google.com>
  • Loading branch information
yoshi-automation and tswast committed Mar 30, 2021
1 parent 8c10713 commit 8a97763
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -12,6 +12,6 @@ repos:
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
rev: 3.9.0
hooks:
- id: flake8
27 changes: 21 additions & 6 deletions noxfile.py
Expand Up @@ -18,6 +18,7 @@

from __future__ import absolute_import
import os
import pathlib
import shutil

import nox
Expand All @@ -30,6 +31,8 @@
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"]

CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()

# 'docfx' is excluded since it only needs to run in 'docs-presubmit'
nox.options.sessions = [
"unit",
Expand Down Expand Up @@ -84,13 +87,15 @@ def lint_setup_py(session):

def default(session):
# Install all test dependencies, then install this package in-place.
session.install("asyncmock", "pytest-asyncio")

session.install(
"mock", "pytest", "pytest-cov",
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
session.install("asyncmock", "pytest-asyncio", "-c", constraints_path)

session.install("mock", "pytest", "pytest-cov", "-c", constraints_path)

session.install("-e", ".[fastavro,pandas,pyarrow]")
session.install("-e", ".[fastavro,pandas,pyarrow]", "-c", constraints_path)

# Run py.test against the unit tests.
session.run(
Expand All @@ -117,6 +122,9 @@ def unit(session):
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
def system(session):
"""Run the system test suite."""
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
system_test_path = os.path.join("tests", "system.py")
system_test_folder_path = os.path.join("tests", "system")

Expand All @@ -141,8 +149,15 @@ def system(session):

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install("mock", "pytest", "google-cloud-testutils", "google-cloud-bigquery")
session.install("-e", ".[fastavro,pandas,pyarrow]")
session.install(
"mock",
"pytest",
"google-cloud-testutils",
"google-cloud-bigquery",
"-c",
constraints_path,
)
session.install("-e", ".[fastavro,pandas,pyarrow]", "-c", constraints_path)

# Run py.test against the system tests.
if system_test_exists:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -29,7 +29,7 @@
"libcst >= 0.2.5",
]
extras = {
"pandas": "pandas>=0.17.1",
"pandas": "pandas>=0.21.1",
"fastavro": "fastavro>=0.21.2",
"pyarrow": "pyarrow>=0.15.0",
}
Expand Down
6 changes: 3 additions & 3 deletions synth.metadata
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/python-bigquery-storage.git",
"sha": "2d981460e62960f273ceb2537a70aeda8cbde5ad"
"sha": "8c1071337ea6c76a61f601b46254e6f07d8f5add"
}
},
{
Expand All @@ -19,14 +19,14 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "79c8dd7ee768292f933012d3a69a5b4676404cda"
"sha": "86ed43d4f56e6404d068e62e497029018879c771"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "79c8dd7ee768292f933012d3a69a5b4676404cda"
"sha": "86ed43d4f56e6404d068e62e497029018879c771"
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions testing/constraints-3.6.txt
Expand Up @@ -9,5 +9,5 @@ google-api-core==1.22.2
proto-plus==1.4.0
libcst==0.2.5
fastavro==0.21.2
pandas==0.17.1
pyarrow==0.15.0
pandas==0.21.1
pyarrow==0.15.0
4 changes: 3 additions & 1 deletion tests/unit/test_reader_v1.py
Expand Up @@ -427,7 +427,9 @@ def test_to_dataframe_empty_w_scalars_avro(class_under_test):
expected["int_col"] = expected["int_col"].astype("int64")
expected["float_col"] = expected["float_col"].astype("float64")
expected["bool_col"] = expected["bool_col"].astype("bool")
expected["ts_col"] = expected["ts_col"].astype("datetime64[ns, UTC]")
expected["ts_col"] = (
expected["ts_col"].astype("datetime64[ns]").dt.tz_localize("UTC")
)

pandas.testing.assert_frame_equal(
got.reset_index(drop=True), # reset_index to ignore row labels
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/test_reader_v1_arrow.py
Expand Up @@ -249,7 +249,9 @@ def test_to_dataframe_empty_w_scalars_arrow(class_under_test):
expected["int_col"] = expected["int_col"].astype("int64")
expected["float_col"] = expected["float_col"].astype("float64")
expected["bool_col"] = expected["bool_col"].astype("bool")
expected["ts_col"] = expected["ts_col"].astype("datetime64[ns, UTC]")
expected["ts_col"] = (
expected["ts_col"].astype("datetime64[ns]").dt.tz_localize("UTC")
)

pandas.testing.assert_frame_equal(
got.reset_index(drop=True), # reset_index to ignore row labels
Expand Down

0 comments on commit 8a97763

Please sign in to comment.