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

fix: fix syntax for DeprecationWarning #942

Merged
merged 1 commit into from
Jun 30, 2021
Merged

Conversation

busunkim96
Copy link
Contributor

@busunkim96 busunkim96 commented Jun 30, 2021

I've verified that the generated code is valid with bigquery datatransfer:

(env) busunkim@busunkim:~/github/googleapis$ protoc google/cloud/bigquery/datatransfer/v1/*.proto --proto_path=../api-common-protos/ --proto_path=. --python_gapic_out=dest
(env) busunkim@busunkim:~/github/googleapis$ cd dest
(env) busunkim@busunkim:~/github/googleapis/dest$ nox -s unit-3.6
nox > Running session unit-3.6
nox > Creating virtual environment (virtualenv) using python3.6 in .nox/unit-3-6
nox > pip install coverage pytest pytest-cov asyncmock pytest-asyncio
nox > pip install -e .
nox > py.test --quiet --cov=google/cloud/bigquery/datatransfer_v1/ --cov-config=.coveragerc --cov-report=term --cov-report=html tests/unit/
....................................................................................................................................................................................................s..s..ss................. [ 94%]
............                                                                                                                                                                                                                  [100%]
========================================================================================================= warnings summary ==========================================================================================================
tests/unit/gapic/datatransfer_v1/test_data_transfer_service.py::test_schedule_transfer_runs
tests/unit/gapic/datatransfer_v1/test_data_transfer_service.py::test_schedule_transfer_runs_from_dict
tests/unit/gapic/datatransfer_v1/test_data_transfer_service.py::test_schedule_transfer_runs_empty_call
tests/unit/gapic/datatransfer_v1/test_data_transfer_service.py::test_schedule_transfer_runs_field_headers
tests/unit/gapic/datatransfer_v1/test_data_transfer_service.py::test_schedule_transfer_runs_flattened
tests/unit/gapic/datatransfer_v1/test_data_transfer_service.py::test_schedule_transfer_runs_flattened_error
  /usr/local/google/home/busunkim/github/googleapis/dest/google/cloud/bigquery/datatransfer_v1/services/data_transfer_service/client.py:1028: DeprecationWarning: DataTransferServiceClient.schedule_transfer_runs is deprecated
    DeprecationWarning)

tests/unit/gapic/datatransfer_v1/test_data_transfer_service.py::test_schedule_transfer_runs_async
tests/unit/gapic/datatransfer_v1/test_data_transfer_service.py::test_schedule_transfer_runs_async_from_dict
tests/unit/gapic/datatransfer_v1/test_data_transfer_service.py::test_schedule_transfer_runs_field_headers_async
tests/unit/gapic/datatransfer_v1/test_data_transfer_service.py::test_schedule_transfer_runs_flattened_async
tests/unit/gapic/datatransfer_v1/test_data_transfer_service.py::test_schedule_transfer_runs_flattened_error_async
  /usr/local/google/home/busunkim/github/googleapis/dest/google/cloud/bigquery/datatransfer_v1/services/data_transfer_service/async_client.py:823: DeprecationWarning: DataTransferServiceAsyncClient.schedule_transfer_runs is deprecated
    DeprecationWarning)

-- Docs: https://docs.pytest.org/en/stable/warnings.html

----------- coverage: platform linux, python 3.6.9-final-0 -----------
Name                                                                                              Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------------------------------------------------------------------------------------
google/cloud/bigquery/datatransfer_v1/__init__.py                                                    33      0      0      0   100%
google/cloud/bigquery/datatransfer_v1/services/__init__.py                                            0      0      0      0   100%
google/cloud/bigquery/datatransfer_v1/services/data_transfer_service/__init__.py                      3      0      0      0   100%
google/cloud/bigquery/datatransfer_v1/services/data_transfer_service/async_client.py                219      0     60      0   100%
google/cloud/bigquery/datatransfer_v1/services/data_transfer_service/client.py                      332      0    122      0   100%
google/cloud/bigquery/datatransfer_v1/services/data_transfer_service/pagers.py                      159      0     40      0   100%
google/cloud/bigquery/datatransfer_v1/services/data_transfer_service/transports/__init__.py           9      0      0      0   100%
google/cloud/bigquery/datatransfer_v1/services/data_transfer_service/transports/base.py              91      4     12      1    95%   45-47, 144
google/cloud/bigquery/datatransfer_v1/services/data_transfer_service/transports/grpc.py             116      0     42      0   100%
google/cloud/bigquery/datatransfer_v1/services/data_transfer_service/transports/grpc_asyncio.py     119      0     42      0   100%
google/cloud/bigquery/datatransfer_v1/types/__init__.py                                               3      0      0      0   100%
google/cloud/bigquery/datatransfer_v1/types/datatransfer.py                                         145      0      0      0   100%
google/cloud/bigquery/datatransfer_v1/types/transfer.py                                              66      0      0      0   100%
---------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                              1295      4    318      1    99%
Coverage HTML written to dir htmlcov

229 passed, 4 skipped, 11 warnings in 3.58s
nox > Session unit-3.6 was successful.

@busunkim96 busunkim96 requested a review from a team as a code owner June 30, 2021 18:28
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jun 30, 2021
@busunkim96 busunkim96 changed the title fix: fix syntax for Deprecationwarning fix: fix syntax for DeprecationWarning Jun 30, 2021
@busunkim96 busunkim96 requested a review from parthea June 30, 2021 18:30
Copy link
Contributor

@tseaver tseaver left a comment

Choose a reason for hiding this comment

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

I was going to suggest that we add stacklevel=2 to the warn() calls, but since we can't tell the user what they should be doing instead, maybe that is less helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants