Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 4bfa587

Browse files
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

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

UPGRADING.md

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
11
# 3.0.0 Migration Guide
22

3-
The 3.0 release of the `google-cloud-datacatalog` client is a significant upgrade based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-python), and includes substantial interface changes. Existing code written for earlier versions of this library will likely require updates to use this version. This document describes the changes that have been made, and what you need to do to update your usage.
3+
This document describes the breaking changes that have been made, and what you need to do to update your usage.
4+
5+
The most significant change was introduced at v2.0 release based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-python), and includes substantial interface changes. Existing code written for eariler versions of this library will likely require updates to use this version.
46

57
If you experience issues or have questions, please file an [issue](https://github.com/googleapis/python-datacatalog/issues).
68

79
## Supported Python Versions
810

11+
| Applicable previous versions |
12+
|:-----------------------------|
13+
| v1.0.0 or lower |
14+
915
> **WARNING**: Breaking change
1016
>
11-
> The 3.0.0 release requires Python 3.6+.
17+
> The 2.0.0 release requires Python 3.6+.
1218
1319

1420
## Method Calls
1521

22+
| Applicable previous versions |
23+
|:-----------------------------|
24+
| v1.0.0 or lower |
25+
1626
> **WARNING**: Breaking change
1727
>
1828
> Methods expect request objects. We provide a script that will convert most common use cases.
@@ -62,7 +72,7 @@ In `google-cloud-datacatalog<=1.0.0`, parameters required by the API were positi
6272
):
6373
```
6474

65-
In the 3.0.0 release, all methods have a single positional parameter `request`. Method docstrings indicate whether a parameter is required or optional.
75+
Since the 2.0.0 release, all methods have a single positional parameter `request`. Method docstrings indicate whether a parameter is required or optional.
6676

6777
Some methods have additional keyword only parameters. The available parameters depend on the `google.api.method_signature` annotation specified by the API producer.
6878

@@ -122,6 +132,9 @@ response = client.create_entry_group(
122132

123133
## Enums and Types
124134

135+
| Applicable previous versions |
136+
|:-----------------------------|
137+
| v2.0.0 or lower |
125138

126139
> **WARNING**: Breaking changes
127140
>
@@ -142,7 +155,22 @@ entry = datacatalog_v1.Entry()
142155
entry.type_ = datacatalog_v1.EntryType.FILESET
143156
```
144157

158+
The renamed attributes are:
159+
160+
* `TagTemplateField.type` -> `TagTemplatedField.type_`
161+
* `ColumnSchema.type` -> `ColumnSchema.type_`
162+
* `Entry.type` -> `Entry.type_`
163+
145164
## Common Resource Path Helper Methods
146165

147-
The `location_path` method existing in `google-cloud-datacatalog<=1.0.0` was renamed to `common_location_path`.
148-
And more resource path helper methods were added: `common_billing_account_path`, `common_folder_path`, `common_organization_path`, and `common_project_path`.
166+
| Applicable previous versions |
167+
|:-----------------------------|
168+
| v1.0.0 or lower |
169+
170+
The `location_path` method existing in `google-cloud-datacatalog<=1.0.0` was renamed to `common_location_path` in v3.0.0.
171+
172+
If you are upgrading from v1.0.0 or lower, modify your code to use new method name.
173+
174+
If you are upgrading from v2.0.0, and constructing paths manually as described in [previous upgrade guide](https://github.com/googleapis/python-datacatalog/blob/v2.0.0/UPGRADING.md#project-path-helper-methods), now you can use `common_location_path` method.
175+
176+
There are also more resource path helper methods were added: `common_billing_account_path`, `common_folder_path`, `common_organization_path`, and `common_project_path`.

0 commit comments

Comments
 (0)