Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: googleapis/python-bigquery-sqlalchemy
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.6.1
Choose a base ref
...
head repository: googleapis/python-bigquery-sqlalchemy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.7.0
Choose a head ref
  • 11 commits
  • 33 files changed
  • 8 contributors

Commits on Apr 13, 2021

  1. chore: add constraints file check for python samples (#119)

    This is the sibling PR to GoogleCloudPlatform/python-docs-samples#5611
    and this is the issue opened for it GoogleCloudPlatform/python-docs-samples#5549
    
    If you look at the files in [this example repo](https://github.com/leahecole/testrepo-githubapp/pull/31/files), you'll see that renovate successfully opened a PR on three constraints files in `samples` directories and subdirectories, and properly ignored `constraints` files at the root level
    
    cc @tswast
    
    TODO:
    
    - [x]   update renovate to check for samples/constraints.txt dependency updates
    - [x]  run lint locally to double check that I'm not introducing lint error
    
    Source-Author: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
    Source-Date: Fri Apr 9 22:50:04 2021 -0700
    Source-Repo: googleapis/synthtool
    Source-Sha: 0a071b3460344886297a304253bf924aa68ddb7e
    Source-Link: googleapis/synthtool@0a071b3
    
    Co-authored-by: Tim Swast <swast@google.com>
    yoshi-automation and tswast authored Apr 13, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8564b79 View commit details
  2. test: move table creation to temporary dataset (#124)

    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:
    - [x] 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
    - [x] Ensure the tests and linter pass
    - [x] Code coverage does not decrease (if any source code was changed)
    - [x] Appropriate docs were updated (if necessary)
    
    Fixes #123 🦕
    tswast authored Apr 13, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9179193 View commit details

Commits on Apr 16, 2021

  1. chore: prevent normalization of semver versioning (#125)

    * chore: prevent normalization of semver versioning
    
    * chore: update setup.py for style
    
    * chore: update workaround to make sic work
    dandhlee authored Apr 16, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    4d169b9 View commit details

Commits on Apr 20, 2021

  1. fix: Select expressions no-longer force use of labels (#129)

    * Fixed a dependency problem that caysed test failures in Python 3.6.
    
    The source of the dependency bug is in old versions of google-cloud-core that
    depend on too-old versions of google-api-core.
    
    * Provide a bigquery mock based on sqlite
    
    So we don't have t mock at the api level.
    
    * Don't force labels in select.
    
    #78
    jimfulton authored Apr 20, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    669b301 View commit details

Commits on Apr 21, 2021

  1. build: use PyPI API token in secret manager (#126)

    This PR was generated using Autosynth. 🌈
    
    Synth log will be available here:
    https://source.cloud.google.com/results/invocations/0132d4b4-e925-416d-8b57-8d018e62ea7c/targets
    
    - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)
    
    Source-Link: googleapis/synthtool@043cc62
    Source-Link: googleapis/synthtool@721339a
    yoshi-automation authored Apr 21, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1201949 View commit details

Commits on Apr 27, 2021

  1. chore(revert): revert preventing normalization (#132)

    reverts previous commit for preventing normalization of versioning
    dandhlee authored Apr 27, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6b35c9b View commit details

Commits on Apr 28, 2021

  1. chore(deps): update dependency pytest to v6.2.3 (#112)

    [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
    
    This PR contains the following updates:
    
    | Package | Change | Age | Adoption | Passing | Confidence |
    |---|---|---|---|---|---|
    | [pytest](https://docs.pytest.org/en/latest/) ([source](https://togithub.com/pytest-dev/pytest), [changelog](https://docs.pytest.org/en/stable/changelog.html)) | `==6.2.2` -> `==6.2.3` | [![age](https://badges.renovateapi.com/packages/pypi/pytest/6.2.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/pytest/6.2.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/pytest/6.2.3/compatibility-slim/6.2.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/pytest/6.2.3/confidence-slim/6.2.2)](https://docs.renovatebot.com/merge-confidence/) |
    
    ---
    
    ### Release Notes
    
    <details>
    <summary>pytest-dev/pytest</summary>
    
    ### [`v6.2.3`](https://togithub.com/pytest-dev/pytest/releases/6.2.3)
    
    [Compare Source](https://togithub.com/pytest-dev/pytest/compare/6.2.2...6.2.3)
    
    # pytest 6.2.3 (2021-04-03)
    
    ## Bug Fixes
    
    -   [#&#8203;8414](https://togithub.com/pytest-dev/pytest/issues/8414): pytest used to create directories under `/tmp` with world-readable
        permissions. This means that any user in the system was able to read
        information written by tests in temporary directories (such as those created by
        the `tmp_path`/`tmpdir` fixture). Now the directories are created with
        private permissions.
    
        pytest used silenty use a pre-existing `/tmp/pytest-of-<username>` directory,
        even if owned by another user. This means another user could pre-create such a
        directory and gain control of another user\\'s temporary directory. Now such a
        condition results in an error.
    
    </details>
    
    ---
    
    ### 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**: Renovate will not automatically rebase this PR, because other commits have been found.
    
    :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/python-bigquery-sqlalchemy).
    renovate-bot authored Apr 28, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    882223d View commit details
  2. chore: add yoshi to CODEOWNERS (#134)

    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> 🦕
    tswast authored Apr 28, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    795ccf7 View commit details

Commits on Apr 29, 2021

  1. chore: add SECURITY.md (#135)

    Co-authored-by: google-cloud-policy-bot[bot] <80869356+google-cloud-policy-bot[bot]@users.noreply.github.com>
    google-cloud-policy-bot[bot] authored Apr 29, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0a3151b View commit details

Commits on May 12, 2021

  1. feat: Comment/description support, bug fixes and better test coverage (

    …#138)
    
    - Runs SQLAlchemy dialect-compliance tests (as system tests).
    - 100% unit-test coverage.
    - Support for table and column comments/descriptions (requiring SQLAlchemy 1.2 or higher).
    - Fixes bugs found while debugging tests, including:
      - Handling of `in` queries.
      - String literals with special characters.
      - Use BIGNUMERIC when necessary.
      - Missing types: BIGINT, SMALLINT, Boolean, REAL, CHAR, NCHAR, VARCHAR, NVARCHAR, TEXT, VARBINARY, DECIMAL
      - Literal bytes, dates, times, datetimes, timestamps, and arrays.
      - Get view definitions.
    - When executing parameterized queries, the new BigQuery DB API parameter syntax is used to pass type information.  This is helpful when the DB API can't determine type information from values, or can't determine it correctly.
    Jim Fulton authored May 12, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fb7c188 View commit details
  2. chore: release 0.7.0 (#142)

    * chore: release 0.7.0
    
    * Update CHANGELOG.md
    
    Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
    Co-authored-by: Jim Fulton <jim@jimfulton.info>
    release-please[bot] and Jim Fulton authored May 12, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f5adfc0 View commit details
4 changes: 1 addition & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -17,8 +17,6 @@
# Generated by synthtool. DO NOT EDIT!
[run]
branch = True
omit =
google/cloud/__init__.py

[report]
fail_under = 100
@@ -35,4 +33,4 @@ omit =
*/proto/*.py
*/core/*.py
*/site-packages/*.py
google/cloud/__init__.py
pybigquery/requirements.py
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -5,8 +5,7 @@
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax

# The @googleapis/api-bigquery is the default owner for changes in this repo
* @googleapis/api-bigquery
* @googleapis/api-bigquery @googleapis/yoshi-python

# The python-samples-reviewers team is the default owner for samples changes
/samples/ @googleapis/python-samples-owners

2 changes: 1 addition & 1 deletion .github/header-checker-lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{"allowedCopyrightHolders": ["Google LLC"],
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt", "**/__init__.py", "samples/**/constraints.txt", "samples/**/constraints-test.txt"],
"sourceFileExtensions": [
"ts",
"js",
4 changes: 2 additions & 2 deletions .kokoro/release.sh
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ python3 -m pip install --upgrade twine wheel setuptools
export PYTHONUNBUFFERED=1

# Move into the package, build the distribution and upload.
TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google_cloud_pypi_password")
TWINE_PASSWORD=$(cat "${KOKORO_GFILE_DIR}/secret_manager/google-cloud-pypi-token")
cd github/python-bigquery-sqlalchemy
python3 setup.py sdist bdist_wheel
twine upload --username gcloudpypi --password "${TWINE_PASSWORD}" dist/*
twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/*
14 changes: 2 additions & 12 deletions .kokoro/release/common.cfg
Original file line number Diff line number Diff line change
@@ -23,18 +23,8 @@ env_vars: {
value: "github/python-bigquery-sqlalchemy/.kokoro/release.sh"
}

# Fetch PyPI password
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "google_cloud_pypi_password"
}
}
}

# Tokens needed to report release status back to GitHub
env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem"
}
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem,google-cloud-pypi-token"
}
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,30 @@

[1]: https://pypi.org/project/pybigquery/#history

## [0.7.0](https://www.github.com/googleapis/python-bigquery-sqlalchemy/compare/v0.6.1...v0.7.0) (2021-05-12)


### Features

* Comment/description support, bug fixes and better test coverage ([#138](https://www.github.com/googleapis/python-bigquery-sqlalchemy/issues/138)) ([fb7c188](https://www.github.com/googleapis/python-bigquery-sqlalchemy/commit/fb7c188fd1d61f2bb2b99742f62042576bff02a9))
* Runs SQLAlchemy dialect-compliance tests (as system tests).
* 100% unit-test coverage.
* Support for table and column comments/descriptions (requiring SQLAlchemy 1.2 or higher).
* When executing parameterized queries, the new BigQuery DB API parameter syntax is used to pass type information. This is helpful when the DB API can't determine type information from values, or can't determine it correctly.

### Bug Fixes

* Select expressions no-longer force use of labels ([#129](https://www.github.com/googleapis/python-bigquery-sqlalchemy/issues/129)) ([669b301](https://www.github.com/googleapis/python-bigquery-sqlalchemy/commit/669b301359f9f37c5c7286a245080b8af2567186))

* Additional fixes, including:
- Handling of `in` queries.
- String literals with special characters.
- Use BIGNUMERIC when necessary.
- Missing types: BIGINT, SMALLINT, Boolean, REAL, CHAR, NCHAR, VARCHAR, NVARCHAR, TEXT, VARBINARY, DECIMAL
- Literal bytes, dates, times, datetimes, timestamps, and arrays.
- Get view definitions.


### [0.6.1](https://www.github.com/googleapis/python-bigquery-sqlalchemy/compare/v0.6.0...v0.6.1) (2021-04-12)


7 changes: 7 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Security Policy

To report a security issue, please use [g.co/vulnz](https://g.co/vulnz).

The Google Security Team will respond within 5 working days of your report on g.co/vulnz.

We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue.
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -2,6 +2,6 @@ sqlalchemy>=1.1.9
google-cloud-bigquery>=1.6.0
future==0.18.2

pytest==6.2.2
pytest==6.2.3
pytest-flake8==1.0.7
pytz==2021.1
13 changes: 12 additions & 1 deletion docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
div#python2-eol {
border-color: red;
border-width: medium;
}
}

/* Ensure minimum width for 'Parameters' / 'Returns' column */
dl.field-list > dt {
min-width: 100px
}

/* Insert space between methods for readability */
dl.method {
padding-top: 10px;
padding-bottom: 10px
}

/* Insert empty space between classes */
dl.class {
padding-bottom: 50px
}
61 changes: 57 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -28,17 +28,18 @@
BLACK_PATHS = ["docs", "pybigquery", "tests", "noxfile.py", "setup.py"]

DEFAULT_PYTHON_VERSION = "3.8"
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
SYSTEM_TEST_PYTHON_VERSIONS = ["3.9"]
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 = [
"lint",
"unit",
"system",
"cover",
"lint",
"system",
"compliance",
"lint_setup_py",
"blacken",
"docs",
@@ -169,6 +170,58 @@ def system(session):
)


@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
def compliance(session):
"""Run the system test suite."""
constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
system_test_folder_path = os.path.join("tests", "sqlalchemy_dialect_compliance")

# Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.
if os.environ.get("RUN_COMPLIANCE_TESTS", "true") == "false":
session.skip("RUN_COMPLIANCE_TESTS is set to false, skipping")
# Sanity check: Only run tests if the environment variable is set.
if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""):
session.skip("Credentials must be set via environment variable")
# Install pyopenssl for mTLS testing.
if os.environ.get("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true":
session.install("pyopenssl")
# Sanity check: only run tests if found.
if not os.path.exists(system_test_folder_path):
session.skip("Compliance tests were not found")

# Use pre-release gRPC for system tests.
session.install("--pre", "grpcio")

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

session.run(
"py.test",
"-vv",
f"--junitxml=compliance_{session.python}_sponge_log.xml",
"--reruns=3",
"--reruns-delay=60",
"--only-rerun="
"403 Exceeded rate limits|"
"409 Already Exists|"
"404 Not found|"
"400 Cannot execute DML over a non-existent table",
system_test_folder_path,
*session.posargs,
)


@nox.session(python=DEFAULT_PYTHON_VERSION)
def cover(session):
"""Run the final coverage report.
@@ -177,7 +230,7 @@ def cover(session):
test runs (not system test runs), and then erases coverage data.
"""
session.install("coverage", "pytest-cov")
session.run("coverage", "report", "--show-missing", "--fail-under=50")
session.run("coverage", "report", "--show-missing", "--fail-under=100")

session.run("coverage", "erase")

Loading