You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package provides type stubs for the [Google Ads API Client Library for Python](https://github.com/googleads/google-ads-python).
6
-
It's currently compatible with v.9.0.0 of this library. It allows you to type check usage of the library with e.g. [mypy](http://mypy-lang.org/) and will also improve autocomplete in many editors.
6
+
It's currently compatible with v14.0.0 of this library. It allows you to type check usage of the library with e.g. [mypy](http://mypy-lang.org/) and will also improve autocomplete in many editors.
7
7
8
8
**This is in no way affiliated with Google.**
9
9
10
-
The stubs for protobuf messages were created by [mypy-protobuf](https://github.com/dropbox/mypy-protobuf).
11
-
The rest were created either by hand or by self-made scripts, with the output of MyPy's `stubgen` as
12
-
a starting point.
10
+
Most stubs were created automatically by [stubgen](https://mypy.readthedocs.io/en/stable/stubgen.html), the rest are handwritten or generated by self-made scripts.
13
11
14
12
If you find incorrect annotations, please create an issue. Contributions for fixes are also welcome.
While it is technically possible to type these methods using a combination of overloading and literal types,
46
-
this is not included in these stubs. The reason is that it requires about 10,000 overloads, which, while simple
47
-
to generate, slows type checking to a crawl.
44
+
this is not included in these stubs. The reason is that it requires about 10,000 overloads, which makes most typecheckers fairly slow.
48
45
49
-
This package does not provide complete type annotations, although it should cover what's used by most developers.
50
-
The bare output from `stubgen` is used by the ransport classes. These may be typed in the future if there is a need for it.
46
+
Another big caveat since v8.0.0 of this package is that the attributes and constructor arguments of the protobuf messages are all typed as `Any` instead of their proper types. This is due to `google-ads-python` switching from raw protobuf message classes to `proto-plus` classes. Better types for these might be introduced in the future. `GoogleAdsClient.enums` is also typed as `Any`.
51
47
52
-
Some service methods allow you to pass in either a protobuf message or a dictionary for certain arguments.
53
-
There is no check that the dictionary conforms to the message structure, as this would require a `TypedDict` subclass
54
-
for each message.
55
48
56
-
Note that if you're using Mypy you need to use the `--namespace-packages` option as `google` and `google.ads` are namespace packages.
49
+
Note that if you're using Mypy you need to use the `--namespace-packages` option as `google` and `google.ads` are namespace packages.
0 commit comments