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

Change download_video parameter to resourceName #20528

Merged
merged 3 commits into from
Dec 30, 2021

Conversation

mishc9
Copy link
Contributor

@mishc9 mishc9 commented Dec 27, 2021

The GoogleDisplayVideo360Hook.download_media hook tries to download media using the
"resource_name" argument. Changed parameter name in internal download_media call to
the "resourceName" according the API spec. Also changed parameter name in tests.

closes: #14077
related: #14077

@boring-cyborg boring-cyborg bot added area:providers provider:google Google (including GCP) related issues labels Dec 27, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Dec 27, 2021

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@eladkal
Copy link
Contributor

eladkal commented Dec 28, 2021

There are some test failures:

tests/providers/google/marketing_platform/operators/test_display_video.py::TestGoogleDisplayVideo360SDFtoGCSOperator::test_execute: KeyError: 'response'
tests/providers/google/marketing_platform/operators/test_display_video.py::TestGoogleDisplayVideo360CreateSDFDownloadTaskOperator::test_execute: TypeError: 'NoneType' object is not subscriptable

@potiuk
Copy link
Member

potiuk commented Dec 28, 2021

Some tests are failing unfortunately :(

Added mock for xcom_push support. Restored old way to provide
resourse_name received from get_sdf_download_operation. Renamed
operation to operation_state for clarity.
@mishc9
Copy link
Contributor Author

mishc9 commented Dec 29, 2021

Some tests are failing unfortunately :(

I fixed tests and ran them locally. Also I reverted changes in get_sdf_download_operator from this request.

(I haven't tested these changes against real Google Cloud yet)

@potiuk
Copy link
Member

potiuk commented Dec 29, 2021

Some static checks - I recommend installing pre-commit ! @mishc9 -> BTW. Is it possible you test it today? Then I could include that change in the December release of providers.

@potiuk potiuk self-requested a review December 29, 2021 12:22
@mishc9
Copy link
Contributor Author

mishc9 commented Dec 29, 2021

Ok, I'll do pre-commit checks next time, thanks :)

I'm not sure yet if I can test it today. It might happen after ~18:00 utc; but more likely tomorrow.

@github-actions
Copy link

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Dec 30, 2021
@potiuk
Copy link
Member

potiuk commented Dec 30, 2021

I'm not sure yet if I can test it today. It might happen after ~18:00 utc; but more likely tomorrow.

If you can make a quick check today - fantastic, if not - we can test it in RC - i'd love to get that one included too in the release.

@potiuk potiuk merged commit a6e60ce into apache:main Dec 30, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Dec 30, 2021

Awesome work, congrats on your first merged pull request!

@mishc9
Copy link
Contributor Author

mishc9 commented Dec 30, 2021

I tried to test it using example_display_video.py, but encountered an authentication problem with Google Cloud API (like googleapiclient.errors.HttpError: <HttpError 403 when requesting https://displayvideo.googleapis.com/v1/sdfdownloadtasks?alt=json returned "Request had insufficient authentication scopes." ...perhaps I set up authorisation the wrong way)

I'm quite new to Google Cloud, so the reason is obscure to me and it looks like I won't test these changes today unfortunately. Will try it later though :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers okay to merge It's ok to merge this PR as it does not require more tests provider:google Google (including GCP) related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GoogleDisplayVideo360Hook.download_media does not pass the resourceName correctly
3 participants