This repository was archived by the owner on Sep 5, 2023. It is now read-only.
Commit 4bfa587
authored
docs: fix upgrade guide (#114)
Current upgrade guide is confusing especially when upgrading from v2.0.0 to v3.0.0 because some of the change is only introduced at v2.0.0. I fixed this.
This is just a documentation fix rather than code fix, so note that following checks are not passed
---
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-datacatalog/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> 🦕
---
## Additional question
There are three way to invoke API-calling methods: (1) pass keyword arguments, (2) pass `request` argument with request class and (3) pass `request` argument with dict.
The auto-migration tool `fixup_datacatalog_v1_keywords.py` fixes code to use method (3) even if the methods accepts keyword arguments. However, IMO, it's poorly typed and not linter/autocompletion-friendly.
Actually what is the recommended way? And is there a plan to remove support of method (1)?
| | Available since | Typed | Note |
|:---|:---|:---|:---|
| (1) | v1 | ◎ (since v2) | |
| (2) | v2 | △ | Code looks redundant |
| (3) | v2 | ☓ | |
(1)
```py
response = client.create_entry_group(
parent=parent,
entry_group_id=entry_group_id,
entry_group=entry_group
)
```
(2)
```py
response = client.create_entry_group(
datacatalog.CreateEntryGroupRequest(
parent=parent,
entry_group_id=entry_group_id,
entry_group=entry_group
)
)
```
(3)
```py
response = client.create_entry_group(
request={
"parent": parent,
"entry_group_id": entry_group_id,
"entry_group": entry_group
}
)
```1 parent 2f98f22 commit 4bfa587
1 file changed
+33
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
9 | 15 | | |
10 | 16 | | |
11 | | - | |
| 17 | + | |
12 | 18 | | |
13 | 19 | | |
14 | 20 | | |
15 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
16 | 26 | | |
17 | 27 | | |
18 | 28 | | |
| |||
62 | 72 | | |
63 | 73 | | |
64 | 74 | | |
65 | | - | |
| 75 | + | |
66 | 76 | | |
67 | 77 | | |
68 | 78 | | |
| |||
122 | 132 | | |
123 | 133 | | |
124 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
125 | 138 | | |
126 | 139 | | |
127 | 140 | | |
| |||
142 | 155 | | |
143 | 156 | | |
144 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
145 | 164 | | |
146 | 165 | | |
147 | | - | |
148 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
0 commit comments