Skip to content

Commit d9896fd

Browse files
authored
Fix dynamic imports in google ads vendored in library (#30544)
This is a further fix to vendor-in google-ads library: * moving from _vendor to google_vendor is needed to keep the tree structure separate from `google` package used in google provider. If we do not do that, ads library will find "google" package when walking up the tree and will determine that this is the "top" google package * dynamic imports of ads library imports have been updated to also import from the vendored-in library * only v12 version is supported Closes: #30526
1 parent 85b9135 commit d9896fd

File tree

1,308 files changed

+4037
-4020
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,308 files changed

+4037
-4020
lines changed

β€Ž.pre-commit-config.yaml

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ repos:
3434
name: Add TOC for Markdown and RST files
3535
files:
3636
^CONTRIBUTING\.md$|^README\.md$|^UPDATING.*\.md$|^chart/UPDATING.*\.md$|^dev/.*\.md$|^dev/.*\.rst$
37-
exclude: ^.*/_vendor/
37+
exclude: ^.*/.*_vendor/
3838
args:
3939
- "--maxlevel"
4040
- "2"
@@ -47,7 +47,7 @@ repos:
4747
exclude: |
4848
(?x)
4949
^\.github/|
50-
^.*/_vendor/
50+
^.*/.*_vendor/
5151
args:
5252
- --comment-style
5353
- "/*||*/"
@@ -56,7 +56,7 @@ repos:
5656
- --fuzzy-match-generates-todo
5757
- id: insert-license
5858
name: Add license for all RST files
59-
exclude: ^\.github/.*$|^.*/_vendor/|newsfragments/.*\.rst$
59+
exclude: ^\.github/.*$|^.*/.*_vendor/|newsfragments/.*\.rst$
6060
args:
6161
- --comment-style
6262
- "||"
@@ -67,7 +67,7 @@ repos:
6767
- id: insert-license
6868
name: Add license for all CSS/JS/JSX/PUML/TS/TSX files
6969
files: \.(css|jsx?|puml|tsx?)$
70-
exclude: ^\.github/.*$|^.*/_vendor/
70+
exclude: ^\.github/.*$|^.*/.*_vendor/
7171
args:
7272
- --comment-style
7373
- "/*!| *| */"
@@ -77,7 +77,7 @@ repos:
7777
- id: insert-license
7878
name: Add license for all JINJA template files
7979
files: ^airflow/www/templates/.*\.html$
80-
exclude: ^\.github/.*$|^.*/_vendor/
80+
exclude: ^\.github/.*$|^.*/.*_vendor/
8181
args:
8282
- --comment-style
8383
- "{#||#}"
@@ -86,7 +86,7 @@ repos:
8686
- --fuzzy-match-generates-todo
8787
- id: insert-license
8888
name: Add license for all Shell files
89-
exclude: ^\.github/.*$|^.*/_vendor/|^dev/breeze/autocomplete/.*$
89+
exclude: ^\.github/.*$|^.*/.*_vendor/|^dev/breeze/autocomplete/.*$
9090
files: \.bash$|\.sh$
9191
args:
9292
- --comment-style
@@ -96,7 +96,7 @@ repos:
9696
- --fuzzy-match-generates-todo
9797
- id: insert-license
9898
name: Add license for all Python files
99-
exclude: ^\.github/.*$|^.*/_vendor/
99+
exclude: ^\.github/.*$|^.*/.*_vendor/
100100
files: \.py$|\.pyi$
101101
args:
102102
- --comment-style
@@ -106,7 +106,7 @@ repos:
106106
- --fuzzy-match-generates-todo
107107
- id: insert-license
108108
name: Add license for all XML files
109-
exclude: ^\.github/.*$|^.*/_vendor/
109+
exclude: ^\.github/.*$|^.*/.*_vendor/
110110
files: \.xml$
111111
args:
112112
- --comment-style
@@ -116,7 +116,7 @@ repos:
116116
- --fuzzy-match-generates-todo
117117
- id: insert-license
118118
name: Add license for all YAML files
119-
exclude: ^\.github/.*$|^.*/_vendor/
119+
exclude: ^\.github/.*$|^.*/.*_vendor/
120120
types: [yaml]
121121
files: \.ya?ml$
122122
args:
@@ -128,7 +128,7 @@ repos:
128128
- id: insert-license
129129
name: Add license for all Markdown files
130130
files: \.md$
131-
exclude: ^\.github/.*$|PROVIDER_CHANGES.*\.md$|^.*/_vendor/
131+
exclude: ^\.github/.*$|PROVIDER_CHANGES.*\.md$|^.*/.*_vendor/
132132
args:
133133
- --comment-style
134134
- "<!--|| -->"
@@ -137,7 +137,7 @@ repos:
137137
- --fuzzy-match-generates-todo
138138
- id: insert-license
139139
name: Add license for all other files
140-
exclude: ^\.github/.*$|^.*/_vendor/
140+
exclude: ^\.github/.*$|^.*/.*_vendor/
141141
args:
142142
- --comment-style
143143
- "|#|"
@@ -152,7 +152,7 @@ repos:
152152
- id: black
153153
name: Run black (Python formatter)
154154
args: [--config=./pyproject.toml]
155-
exclude: ^.*/_vendor/|^airflow/contrib/
155+
exclude: ^.*/.*_vendor/|^airflow/contrib/
156156
- repo: local
157157
hooks:
158158
- id: update-common-sql-api-stubs
@@ -181,7 +181,7 @@ repos:
181181
entry: ruff --fix --no-update-check --force-exclude
182182
additional_dependencies: ['ruff==0.0.226']
183183
files: \.pyi?$
184-
exclude: ^.*/_vendor/
184+
exclude: ^.*/.*_vendor/
185185
- repo: https://github.com/asottile/blacken-docs
186186
rev: 1.13.0
187187
hooks:
@@ -204,28 +204,28 @@ repos:
204204
name: Detect accidentally committed debug statements
205205
- id: check-builtin-literals
206206
name: Require literal syntax when initializing Python builtin types
207-
exclude: ^.*/_vendor/
207+
exclude: ^.*/.*_vendor/
208208
- id: detect-private-key
209209
name: Detect if private key is added to the repository
210210
exclude: ^docs/apache-airflow-providers-ssh/connections/ssh.rst$
211211
- id: end-of-file-fixer
212212
name: Make sure that there is an empty line at the end
213-
exclude: ^.*/_vendor/|^docs/apache-airflow/img/.*\.dot|^docs/apache-airflow/img/.*\.sha256
213+
exclude: ^.*/.*_vendor/|^docs/apache-airflow/img/.*\.dot|^docs/apache-airflow/img/.*\.sha256
214214
- id: mixed-line-ending
215215
name: Detect if mixed line ending is used (\r vs. \r\n)
216-
exclude: ^.*/_vendor/
216+
exclude: ^.*/.*_vendor/
217217
- id: check-executables-have-shebangs
218218
name: Check that executables have shebang
219-
exclude: ^.*/_vendor/
219+
exclude: ^.*/.*_vendor/
220220
- id: check-xml
221221
name: Check XML files with xmllint
222-
exclude: ^.*/_vendor/
222+
exclude: ^.*/.*_vendor/
223223
- id: trailing-whitespace
224224
name: Remove trailing whitespace at end of line
225-
exclude: ^.*/_vendor/|^docs/apache-airflow/img/.*\.dot|^images/breeze/output.*$
225+
exclude: ^.*/.*_vendor/|^docs/apache-airflow/img/.*\.dot|^images/breeze/output.*$
226226
- id: fix-encoding-pragma
227227
name: Remove encoding header from Python files
228-
exclude: ^.*/_vendor/
228+
exclude: ^.*/.*_vendor/
229229
args:
230230
- --remove
231231
- id: pretty-format-json
@@ -242,26 +242,26 @@ repos:
242242
hooks:
243243
- id: rst-backticks
244244
name: Check if RST files use double backticks for code
245-
exclude: ^.*/_vendor/
245+
exclude: ^.*/.*_vendor/
246246
- id: python-no-log-warn
247247
name: Check if there are no deprecate log warn
248-
exclude: ^.*/_vendor/
248+
exclude: ^.*/.*_vendor/
249249
- repo: https://github.com/adrienverge/yamllint
250250
rev: v1.29.0
251251
hooks:
252252
- id: yamllint
253253
name: Check YAML files with yamllint
254254
entry: yamllint -c yamllint-config.yml --strict
255255
types: [yaml]
256-
exclude: ^.*airflow\.template\.yaml$|^.*init_git_sync\.template\.yaml$|^.*/_vendor/|^chart/(?:templates|files)/.*\.yaml$|openapi/.*\.yaml$|^\.pre-commit-config\.yaml$
256+
exclude: ^.*airflow\.template\.yaml$|^.*init_git_sync\.template\.yaml$|^.*/.*_vendor/|^chart/(?:templates|files)/.*\.yaml$|openapi/.*\.yaml$|^\.pre-commit-config\.yaml$
257257
- repo: https://github.com/ikamensh/flynt
258258
rev: '0.77'
259259
hooks:
260260
- id: flynt
261261
name: Run flynt string format converter for Python
262262
exclude: |
263263
(?x)
264-
^.*/_vendor/
264+
^.*/.*_vendor/
265265
args:
266266
# If flynt detects too long text it ignores it. So we set a very large limit to make it easy
267267
# to split the text by hand. Too long lines are detected by flake8 (below),
@@ -278,7 +278,7 @@ repos:
278278
The word(s) should be in lowercase." && exec codespell "$@"' --
279279
language: python
280280
types: [text]
281-
exclude: ^.*/_vendor/|^airflow/www/static/css/material-icons\.css$|^images/.*$|^RELEASE_NOTES\.txt$|^.*package-lock\.json$
281+
exclude: ^.*/.*_vendor/|^airflow/www/static/css/material-icons\.css$|^images/.*$|^RELEASE_NOTES\.txt$|^.*package-lock\.json$
282282
args:
283283
- --ignore-words=docs/spelling_wordlist.txt
284284
- --skip=airflow/providers/*/*.rst,airflow/www/*.log,docs/*/commits.rst,docs/apache-airflow/tutorial/pipeline_example.csv,*.min.js,*.lock,INTHEWILD.md
@@ -290,7 +290,7 @@ repos:
290290
entry: ./scripts/ci/pre_commit/pre_commit_replace_bad_characters.py
291291
language: python
292292
types: [file, text]
293-
exclude: ^.*/_vendor/|^clients/gen/go\.sh$|^\.gitmodules$
293+
exclude: ^.*/.*_vendor/|^clients/gen/go\.sh$|^\.gitmodules$
294294
additional_dependencies: ['rich>=12.4.4']
295295
- id: lint-openapi
296296
name: Lint OpenAPI using spectral
@@ -419,7 +419,7 @@ repos:
419419
entry: "^\\s*from\\s+\\."
420420
pass_filenames: true
421421
files: \.py$
422-
exclude: ^.*/_vendor/|^docs/|^tests/
422+
exclude: ^.*/.*_vendor/|^docs/|^tests/
423423
- id: check-urlparse-usage-in-code
424424
language: pygrep
425425
name: Don't use urlparse in code
@@ -483,7 +483,7 @@ repos:
483483
^airflow/www/static/css/bootstrap-theme.css$|
484484
^airflow/www/static/js/types/api-generated.ts$|
485485
^airflow/www/templates/appbuilder/flash.html$|
486-
^.*/_vendor/|
486+
^.*/.*_vendor/|
487487
^dev/|
488488
^docs/README.rst$|
489489
^docs/apache-airflow-providers-amazon/secrets-backends/aws-ssm-parameter-store.rst$|
@@ -536,7 +536,7 @@ repos:
536536
files: >
537537
(?x)
538538
^airflow/providers/.*\.py$
539-
exclude: ^.*/_vendor/
539+
exclude: ^.*/.*_vendor/
540540
- id: check-decorated-operator-implements-custom-name
541541
name: Check @task decorator implements custom_operator_name
542542
language: python
@@ -557,28 +557,28 @@ repos:
557557
to avoid import cycles.
558558
entry: "from airflow\\.utils\\.db import.* (provide_session|create_session)"
559559
files: \.py$
560-
exclude: ^.*/_vendor/
560+
exclude: ^.*/.*_vendor/
561561
pass_filenames: true
562562
- id: check-incorrect-use-of-LoggingMixin
563563
language: pygrep
564564
name: Make sure LoggingMixin is not used alone
565565
entry: "LoggingMixin\\(\\)"
566566
files: \.py$
567-
exclude: ^.*/_vendor/
567+
exclude: ^.*/.*_vendor/
568568
pass_filenames: true
569569
- id: check-daysago-import-from-utils
570570
language: pygrep
571571
name: Make sure days_ago is imported from airflow.utils.dates
572572
entry: "(airflow\\.){0,1}utils\\.dates\\.days_ago"
573573
files: \.py$
574-
exclude: ^.*/_vendor/
574+
exclude: ^.*/.*_vendor/
575575
pass_filenames: true
576576
- id: check-start-date-not-used-in-defaults
577577
language: pygrep
578578
name: "'start_date' not to be defined in default_args in example_dags"
579579
entry: "default_args\\s*=\\s*{\\s*(\"|')start_date(\"|')|(\"|')start_date(\"|'):"
580580
files: \.*example_dags.*\.py$
581-
exclude: ^.*/_vendor/
581+
exclude: ^.*/.*_vendor/
582582
pass_filenames: true
583583
- id: check-apache-license-rat
584584
name: Check if licenses are OK for Apache
@@ -724,7 +724,7 @@ repos:
724724
language: python
725725
pass_filenames: true
726726
files: .*\.schema\.json$
727-
exclude: ^.*/_vendor/
727+
exclude: ^.*/.*_vendor/
728728
require_serial: true
729729
additional_dependencies: ['jsonschema>=3.2.0,<5.0', 'PyYAML==5.3.1', 'requests==2.25.0']
730730
- id: lint-json-schema
@@ -809,7 +809,7 @@ repos:
809809
language: python
810810
pass_filenames: true
811811
files: \.py$
812-
exclude: ^.*/_vendor/
812+
exclude: ^.*/.*_vendor/
813813
additional_dependencies: ['rich>=12.4.4']
814814
- id: lint-chart-schema
815815
name: Lint chart/values.schema.json file
@@ -874,7 +874,7 @@ repos:
874874
language: python
875875
pass_filenames: true
876876
files: \.py$
877-
exclude: ^.*/_vendor/
877+
exclude: ^.*/.*_vendor/
878878
additional_dependencies: ['rich>=12.4.4', 'astor']
879879
- id: create-missing-init-py-files-tests
880880
name: Create missing init.py files in tests
@@ -905,15 +905,15 @@ repos:
905905
language: python
906906
entry: ./scripts/ci/pre_commit/pre_commit_mypy.py --namespace-packages
907907
files: \.py$
908-
exclude: ^.*/_vendor/|^airflow/migrations|^airflow/providers|^dev|^docs|^provider_packages|^tests/providers|^tests/system/providers
908+
exclude: ^.*/.*_vendor/|^airflow/migrations|^airflow/providers|^dev|^docs|^provider_packages|^tests/providers|^tests/system/providers
909909
require_serial: true
910910
additional_dependencies: ['rich>=12.4.4', 'inputimeout', 'pyyaml']
911911
- id: run-mypy-providers
912912
name: Run mypy for providers
913913
language: python
914914
entry: ./scripts/ci/pre_commit/pre_commit_mypy.py --namespace-packages
915915
files: ^airflow/providers/.*\.py$|^tests/providers/\*\.py$|^tests/system/providers/\*\.py$
916-
exclude: ^.*/_vendor/
916+
exclude: ^.*/.*_vendor/
917917
require_serial: true
918918
additional_dependencies: ['rich>=12.4.4', 'inputimeout', 'pyyaml']
919919
- id: run-mypy-docs

β€Ž.rat-excludes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ input_notebook.ipynb
102102
tmp
103103

104104
# Vendored-in code
105-
_vendor
106-
./airflow/providers/google/ads/_vendor
105+
.*_vendor
107106

108107
# generated doc-only-changes.txt
109108
.latest-doc-only-change.txt

β€Žairflow/providers/google/CHANGELOG.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@
2323
Changelog
2424
---------
2525

26+
8.12.1
27+
......
28+
29+
This version of provider contains a temporary workaround to issue with ``v11`` version of
30+
google-ads API being discontinued, while the google provider dependencies preventing installing
31+
any google-ads client supporting ``v12`` API. This version contains vendored-in version of google-ads
32+
library ``20.0.0`` v12 support only. The workaround (and vendored-in library) will be removed
33+
as soon as dependencies of the provider will allow to use google-ads supporting newer
34+
API versions of google-ads.
35+
36+
.. note::
37+
38+
ONLY v12 version of google ads is supported. You should set v12 when your create an operator or client.
39+
2640
8.12.0
2741
......
2842

0 commit comments

Comments
 (0)