Skip to content

Commit 7b95384

Browse files
authored
Regenerate azure-planetarycomputer from TypeSpec commit f6aac155e9a422cf0251498788e5726c3b615bf3 (#45268)
Renamed operations: StacOperations.list_collections → StacOperations.get_collections New models: AssetStatisticsResponse BandStatisticsMap ClassMapLegendResponse QueryableDefinitionsResponse TilerAssetGeoJson TilerInfoMapResponse Return type changes: get_collection_queryables / list_queryables now return QueryableDefinitionsResponse instead of dict[str, Any] get_class_map_legend now returns ClassMapLegendResponse instead of dict[str, Any]
1 parent c8979c5 commit 7b95384

19 files changed

Lines changed: 463 additions & 231 deletions
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# Release History
22

3-
## 1.0.0b1 (2025-12-01)
3+
## 1.0.0b1 (Unreleased)
44

5-
- Initial version
5+
### Features Added
66

7-
### Other Changes
7+
- Added models `AssetStatisticsResponse`, `BandStatisticsMap`, `ClassMapLegendResponse`, `QueryableDefinitionsResponse`, `TilerAssetGeoJson`, `TilerInfoMapResponse`.
8+
- `get_collection_queryables`, `list_queryables` now return `QueryableDefinitionsResponse`.
9+
- `get_class_map_legend` now returns `ClassMapLegendResponse`.
810

9-
- Introduce azure-planetarycomputer.
11+
### Breaking Changes
12+
13+
- Renamed `StacOperations.list_collections` to `StacOperations.get_collections`.

sdk/planetarycomputer/azure-planetarycomputer/CONTRIBUTING.md

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,24 @@ The code generator already produces a file-level suppression on line 1 of each `
7777
| `from collections.abc import MutableMapping` | `# pylint: disable=import-error` | Not resolvable in the pylint virtualenv |
7878
| `return super().__new__(cls)` (in `Model.__new__`) | `# pylint: disable=no-value-for-parameter` | False positive - pylint cannot resolve the MRO for `__new__` |
7979

80-
> **Important:** After adding pylint suppressions, run `tox -e black` first - Black may reformat single-line imports into multi-line, which moves your `# pylint: disable` comments. If Black reformats the `_deserialize_xml` import into multiple lines, the `# pylint: disable=unused-import` comment must be on the `from ... import (` line, **not** on the closing `)` or the individual name line.
80+
> **Critical: Run Black _before_ adding pylint suppressions.** Black reformats imports (turning single-line into multi-line), which changes where `# pylint: disable` comments must go. If you add suppressions first and then run Black, the comments may end up on the wrong line. The correct order is: (1) run `tox -e black`, (2) restore tests/samples, (3) add pylint suppressions.
8181

82-
### Sample Updates
82+
> **Emitter version variability:** The emitter may add different inline suppressions to different functions. For example, `build_data_get_mosaics_tile_json_request` gets the full `too-many-locals,too-many-branches,too-many-statements`, while `build_data_get_mosaics_tile_request` only gets `too-many-locals`. Always check the pylint output to see if additional suppressions are needed beyond what the emitter provides.
83+
84+
### Sphinx Docstring Fixes
85+
86+
The code generator sometimes produces RST formatting bugs in docstrings (e.g., code block terminators merged with following text, incorrect bullet continuation indentation). These must be fixed in **both** sync and async `_operations.py`. Run `tox -e sphinx` after each regeneration — Sphinx treats warnings as errors, so any formatting issues will cause a build failure.
87+
88+
### Sample and Test Updates
8389

8490
If the TypeSpec renames or removes API operations, the hand-written samples under `samples/` and `samples/async/` must be updated to match. MyPy and Pyright (which also check samples) will catch these as type errors.
8591

92+
**Test updates require special care:**
93+
94+
- **Do NOT rename test methods** even if the SDK method they test was renamed. Test method names determine recording file paths. Renaming a test method breaks the recording lookup — only change the API call *inside* the test body.
95+
- **Update type assertions** if an API's return type changes (e.g., from `dict` to a typed model). The test assertions must match the new return type.
96+
- **Run tests in playback mode** (`pytest tests/ -v`) after all fixes to verify all tests pass.
97+
8698
---
8799

88100
## Local Validation
@@ -269,15 +281,21 @@ Each file has a sync and async variant (e.g., `test_00_stac_collection.py` and `
269281

270282
After running `npx tsp-client update`:
271283

272-
- [ ] Restore `tests/` and `samples/` - `git checkout -- tests/ samples/`
284+
- [ ] Delete `generated_samples/` and `generated_tests/`
285+
- [ ] Restore `tests/` and `samples/` — `git checkout -- tests/ samples/`
286+
- [ ] Run `tox -e black` — formatting (MUST be done before adding pylint suppressions)
287+
- [ ] Restore `tests/` and `samples/` again if Black modified them
273288
- [ ] Add inline `# pylint: disable=import-error` to `MutableMapping` imports (3 files)
274289
- [ ] Add `# pylint: disable=unused-import` on the `from ... import (` line for `_deserialize_xml` (2 files)
275-
- [ ] Add `# pylint: disable=too-many-locals,too-many-branches,too-many-statements` inline on `build_data_get_mosaics_tile_request` (sync `_operations.py` only)
290+
- [ ] Add `# pylint: disable=too-many-locals,too-many-branches,too-many-statements` inline on `build_data_get_mosaics_tile_*` functions (check emitter output — may need to add missing suppressions)
276291
- [ ] Add inline `# pylint: disable=no-value-for-parameter` to `Model.__new__` in `model_base.py`
277-
- [ ] Run `tox -e black` - formatting (may reformat imports; re-check pylint comment placement)
278-
- [ ] Restore `tests/` and `samples/` again if Black modified them
279-
- [ ] Run `tox -e pylint` - linting (should score 10.00/10)
280-
- [ ] Run `tox -e sphinx` - documentation
281-
- [ ] Run `tox -e mypy` and `tox -e pyright` - type checking (will catch renamed/removed APIs in samples)
292+
- [ ] Fix any Sphinx docstring issues (both sync and async `_operations.py`) — check `tox -e sphinx` output
293+
- [ ] Run `tox -e pylint` — linting (should score 10.00/10)
294+
- [ ] Run `tox -e sphinx` — documentation (should build with 0 warnings)
295+
- [ ] Run `tox -e mypy` and `tox -e pyright` — type checking (will catch renamed/removed APIs in samples)
282296
- [ ] Update samples if any operations were renamed or removed
297+
- [ ] Update tests: fix API calls (not method names!), update `isinstance` checks for changed return types
298+
- [ ] Run `pytest tests/ -v` in playback mode — should be 202 passed
299+
- [ ] Run `tox -e apistub` — API stub generation
300+
- [ ] Re-record tests if HTTP request/response data changed (see Testing section)
283301
- [ ] Update `CHANGELOG.md` with a release date if preparing a release

sdk/planetarycomputer/azure-planetarycomputer/apiview-properties.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"CrossLanguagePackageId": "Microsoft.PlanetaryComputer",
33
"CrossLanguageDefinitionId": {
44
"azure.planetarycomputer.models.AssetMetadata": "Microsoft.PlanetaryComputer.AssetMetadata",
5+
"azure.planetarycomputer.models.AssetStatisticsResponse": "Microsoft.PlanetaryComputer.AssetStatisticsResponse",
56
"azure.planetarycomputer.models.BandStatistics": "Microsoft.PlanetaryComputer.BandStatistics",
7+
"azure.planetarycomputer.models.BandStatisticsMap": "Microsoft.PlanetaryComputer.BandStatisticsMap",
8+
"azure.planetarycomputer.models.ClassMapLegendResponse": "ClassMapLegendResponse",
69
"azure.planetarycomputer.models.DefaultLocation": "Microsoft.PlanetaryComputer.DefaultLocation",
710
"azure.planetarycomputer.models.ErrorInfo": "Microsoft.PlanetaryComputer.ErrorInfo",
811
"azure.planetarycomputer.models.Feature": "Feature",
@@ -27,6 +30,7 @@
2730
"azure.planetarycomputer.models.PartitionType": "Microsoft.PlanetaryComputer.PartitionType",
2831
"azure.planetarycomputer.models.Point": "Point",
2932
"azure.planetarycomputer.models.Polygon": "Polygon",
33+
"azure.planetarycomputer.models.QueryableDefinitionsResponse": "Microsoft.PlanetaryComputer.QueryableDefinitionsResponse",
3034
"azure.planetarycomputer.models.RenderOption": "Microsoft.PlanetaryComputer.RenderOption",
3135
"azure.planetarycomputer.models.RenderOptionCondition": "Microsoft.PlanetaryComputer.RenderOptionCondition",
3236
"azure.planetarycomputer.models.RenderOptionLegend": "Microsoft.PlanetaryComputer.RenderOptionLegend",
@@ -66,9 +70,11 @@
6670
"azure.planetarycomputer.models.TileMatrix": "TileMatrix",
6771
"azure.planetarycomputer.models.TileMatrixSet": "TileMatrixSet",
6872
"azure.planetarycomputer.models.TileMatrixSetBoundingBox": "TileMatrixSetBoundingBox",
73+
"azure.planetarycomputer.models.TilerAssetGeoJson": "Microsoft.PlanetaryComputer.TilerAssetGeoJson",
6974
"azure.planetarycomputer.models.TilerCoreModelsResponsesPoint": "Microsoft.PlanetaryComputer.TilerCoreModelsResponsesPoint",
7075
"azure.planetarycomputer.models.TilerInfo": "Microsoft.PlanetaryComputer.TilerInfo",
7176
"azure.planetarycomputer.models.TilerInfoGeoJsonFeature": "Microsoft.PlanetaryComputer.TilerInfoGeoJsonFeature",
77+
"azure.planetarycomputer.models.TilerInfoMapResponse": "Microsoft.PlanetaryComputer.TilerInfoMapResponse",
7278
"azure.planetarycomputer.models.TilerMosaicSearchRegistrationResponse": "Microsoft.PlanetaryComputer.TilerMosaicSearchRegistrationResponse",
7379
"azure.planetarycomputer.models.TilerStacItemStatistics": "Microsoft.PlanetaryComputer.TilerStacItemStatistics",
7480
"azure.planetarycomputer.models.TilerStacSearchDefinition": "Microsoft.PlanetaryComputer.TilerStacSearchDefinition",
@@ -162,8 +168,8 @@
162168
"azure.planetarycomputer.aio.operations.StacOperations.begin_delete_collection": "Customizations.Stac.deleteCollection",
163169
"azure.planetarycomputer.operations.StacOperations.get_collection": "Customizations.Stac.getCollection",
164170
"azure.planetarycomputer.aio.operations.StacOperations.get_collection": "Customizations.Stac.getCollection",
165-
"azure.planetarycomputer.operations.StacOperations.list_collections": "Customizations.Stac.listCollections",
166-
"azure.planetarycomputer.aio.operations.StacOperations.list_collections": "Customizations.Stac.listCollections",
171+
"azure.planetarycomputer.operations.StacOperations.get_collections": "Customizations.Stac.getCollections",
172+
"azure.planetarycomputer.aio.operations.StacOperations.get_collections": "Customizations.Stac.getCollections",
167173
"azure.planetarycomputer.operations.StacOperations.get_partition_type": "Customizations.Stac.getPartitionType",
168174
"azure.planetarycomputer.aio.operations.StacOperations.get_partition_type": "Customizations.Stac.getPartitionType",
169175
"azure.planetarycomputer.operations.StacOperations.replace_partition_type": "Customizations.Stac.replacePartitionType",

sdk/planetarycomputer/azure-planetarycomputer/azure/planetarycomputer/_types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@
99
from typing import Union
1010

1111
BandMetadataElement = Union[str, dict[str, str]]
12-
IntervalLegendsElement = Union[list[int], dict[str, str]]

0 commit comments

Comments
 (0)