Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add prerelease session to test with latest dependencies, separate compliance tests #401

Merged
merged 17 commits into from
Feb 17, 2022

Conversation

tswast
Copy link
Collaborator

@tswast tswast commented Jan 18, 2022

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Towards googleapis/python-bigquery#1021 "Test connectors, such as pandas-gbq and sqlalchemy-bigquery with pre-release, make updates if needed."

Towards #413

Internal CL 422873148 to enable these test sessions in Kokoro.

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API. label Jan 18, 2022
@tswast
Copy link
Collaborator Author

tswast commented Jan 18, 2022

Prerelease tests pass locally:

(dev-3.9) ➜  python-bigquery-sqlalchemy git:(tswast-prerelease) nox -s prerelease   
nox > Running session prerelease
nox > Creating virtual environment (virtualenv) using python3.8 in .nox/prerelease
nox > python -m pip install --prefer-binary --pre --upgrade google-api-core google-cloud-bigquery google-cloud-bigquery-storage google-cloud-core google-resumable-media grpcio
nox > python -m pip install freezegun google-cloud-testutils mock psutil pytest pytest-cov pytz
nox > python -m pip install sqlalchemy google-auth google-cloud-bigquery google-api-core
nox > python -m pip install --no-deps -e .[all]
nox > python -m pip freeze
attrs==21.4.0
cachetools==4.2.4
certifi==2021.10.8
charset-normalizer==2.0.10
click==8.0.3
coverage==6.2
freezegun==1.1.0
google-api-core==2.4.0
google-auth==2.3.3
google-cloud-bigquery==3.0.0b1
google-cloud-bigquery-storage==2.11.0
google-cloud-core==2.2.2
google-cloud-testutils==1.3.1
google-crc32c==1.3.0
google-resumable-media==2.1.0
googleapis-common-protos==1.54.0
greenlet==1.1.2
grpcio==1.43.0
grpcio-status==1.43.0
idna==3.3
iniconfig==1.1.1
libcst==0.4.0
mock==4.0.3
mypy-extensions==0.4.3
numpy==1.22.1
packaging==21.3
pluggy==1.0.0
proto-plus==1.19.8
protobuf==3.19.3
psutil==5.9.0
py==1.11.0
pyarrow==6.0.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
pyparsing==3.0.6
pytest==6.2.5
pytest-cov==3.0.0
python-dateutil==2.8.2
pytz==2021.3
PyYAML==6.0
requests==2.27.1
rsa==4.8
six==1.16.0
SQLAlchemy==1.4.29
-e git+ssh://[email protected]/tswast/python-bigquery-sqlalchemy.git@129f2747ae820d75a4dd5eafb942a5bdbd32e3d5#egg=sqlalchemy_bigquery
toml==0.10.2
tomli==2.0.0
typing-inspect==0.7.1
typing_extensions==4.0.1
urllib3==1.26.8
nox > py.test --quiet --junitxml=prerelease_unit_3.8_sponge_log.xml tests/unit
======================================================================== test session starts =========================================================================
platform darwin -- Python 3.8.10, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /Users/swast/src/github.com/googleapis/python-bigquery-sqlalchemy, configfile: setup.cfg
plugins: cov-3.0.0
collected 226 items / 1 skipped / 225 selected                                                                                                                       

tests/unit/test__struct.py ....................                                                                                                                [  8%]
tests/unit/test_catalog_functions.py ..........................................                                                                                [ 27%]
tests/unit/test_comments.py .....                                                                                                                              [ 29%]
tests/unit/test_compiler.py .....                                                                                                                              [ 31%]
tests/unit/test_compliance.py ..........                                                                                                                       [ 36%]
tests/unit/test_dialect_types.py .                                                                                                                             [ 36%]
tests/unit/test_engine.py ......                                                                                                                               [ 39%]
tests/unit/test_helpers.py .........                                                                                                                           [ 43%]
tests/unit/test_like_reescape.py .                                                                                                                             [ 43%]
tests/unit/test_parse_url.py ......................................                                                                                            [ 60%]
tests/unit/test_select.py ..................................................s....s...........                                                                  [ 90%]
tests/unit/test_sqlalchemy_bigquery.py .....................                                                                                                   [ 99%]
tests/unit/test_view.py .                                                                                                                                      [100%]

---------------------- generated xml file: /Users/swast/src/github.com/googleapis/python-bigquery-sqlalchemy/prerelease_unit_3.8_sponge_log.xml ----------------------
================================================================== 224 passed, 3 skipped in 14.81s ===================================================================
nox > py.test --quiet --junitxml=prerelease_system_3.8_sponge_log.xml tests/system
======================================================================== test session starts =========================================================================
platform darwin -- Python 3.8.10, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /Users/swast/src/github.com/googleapis/python-bigquery-sqlalchemy, configfile: setup.cfg
plugins: cov-3.0.0
collected 49 items / 2 skipped / 47 selected                                                                                                                         

tests/system/test__struct.py ...                                                                                                                               [  6%]
tests/system/test_helpers.py ssss                                                                                                                              [ 14%]
tests/system/test_sqlalchemy_bigquery.py ..........................................                                                                            [100%]

--------------------- generated xml file: /Users/swast/src/github.com/googleapis/python-bigquery-sqlalchemy/prerelease_system_3.8_sponge_log.xml ---------------------
============================================================= 45 passed, 6 skipped in 284.47s (0:04:44) ==============================================================

Even though we use the latest SQLAlchemy, it is passing since we aren't running against the compliance test suite (yet?).

@tswast tswast changed the title test: add prerelease session to test with latest dependencies test: add prerelease session to test with latest dependencies, separate compliance tests Jan 19, 2022
@@ -183,6 +183,75 @@ def system(session):
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
def prerelease(session):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Mostly taken straight from https://github.com/googleapis/python-bigquery-pandas/blob/d4539747848156446d8a3ccdb49661e72ae03109/noxfile.py#L176

googleapis/synthtool#1290 is open to add this to the templates, though it would need to be slightly templated to allow for customized prerelease dependencies.

@tswast tswast marked this pull request as ready for review January 19, 2022 20:47
@tswast tswast requested a review from a team January 19, 2022 20:47
@tswast tswast requested a review from a team as a code owner January 19, 2022 20:47
@tswast tswast requested a review from steffnay January 19, 2022 20:47
@tswast tswast added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jan 19, 2022
@tswast

This comment has been minimized.

noxfile.py Outdated Show resolved Hide resolved
@tswast tswast removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jan 20, 2022
@tswast
Copy link
Collaborator Author

tswast commented Feb 14, 2022

FYI: a pytest release in the past month broke the compliance test suite: #413

Edit: Fixed by capping pytest version to less than 7.

@tswast tswast added do not merge Indicates a pull request not ready for merge, due to either quality or timing. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Feb 14, 2022
Copy link
Contributor

@parthea parthea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Added 1 observation

noxfile.py Outdated
Comment on lines 196 to 199
"google-cloud-bigquery-storage",
"google-cloud-core",
"google-resumable-media",
"grpcio",
Copy link
Contributor

@parthea parthea Feb 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 4 don't appear in setup.py . Please could you add a comment to clarify the reason that they're included here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. Possibly we should add google-cloud-bigquery-storage to setup.py in a separate PR. It's an "extra" but one that'll raise a warning if not present. The others we get via transitive dependencies. I'll comment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mailed #414 which updates some of the dependencies in setup.py to better reflect reality.

Also, remove google-resumable-media from prerelease tests, as this package does
not use load jobs.
@tswast tswast merged commit 7f36628 into main Feb 17, 2022
@tswast tswast deleted the tswast-prerelease branch February 17, 2022 18:24
gcf-merge-on-green bot pushed a commit that referenced this pull request Mar 22, 2022
…ing (#414)

The wrapped DB-API uses google-cloud-bigquery-storage to download query
results by default. It raises a warning and falls back to the REST API
if google-cloud-bigquery-storage is not installed.

The google-cloud-bigquery version 3.x library is tested in #401 and it does not include any breaking changes that should affect the SQLAlchemy connector.

deps: allow google-cloud-bigquery version 3.x

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-bigquery-sqlalchemy/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants