ITADN

Fix: fix shapely import

#588Pull Requestpjonsson 创建于 2026-02-25
P
pjonssoncommented
<!-- Provide a general summary of your proposed changes in the Title field above --> <!-- The title should have the following form: 'Type: Subject' with 'type' in [Build,Chore,CI,Deprecate,Docs,Feat,Fix,Perf,Refactor,Revert,Style,Test] --> ### Description After upgrading from geoalchemy2 0.18.1 to 0.18.3, pyright started reporting type errors in what looks like fairly innocent code. Without this, pyright gives the error: file.py:line:column - error: Type "Geometry | Unbound" is not assignable to return type "BaseGeometry | None"   Type "Geometry | Unbound" is not assignable to type "BaseGeometry | None"     Type "Geometry" is not assignable to type "BaseGeometry | None"       "Geometry" is not assignable to "BaseGeometry"       "Geometry" is not assignable to "None" (reportReturnType) on the line "return to_shape(value)" in a method declared as returning BaseGeometry | None. The use of BaseGeometry as return value from wkt.loads() is consistent with the type stubs in Typeshed. ### Checklist <!-- Go over following points. Check them with an `x` if they do apply (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once). --> This pull request is: - [ ] A documentation / typographical error fix - Good to go, no issue or tests are needed - [X] A short code fix - [ ] Please include: `Fixes: #<issue number>` in the description if it solves an existing issue (which must include a complete example of the issue). - [ ] Please include tests that fail with the `main` branch and pass with the provided fix. - [ ] A new feature implementation or update an existing feature - [ ] Please include: `Fixes: #<issue number>` in the description if it solves an existing issue (which must include a complete example of the feature). - [ ] Please include tests that cover every lines of the new/updated feature. - [ ] Please update the documentation to describe the new/updated feature. <!-- **Have a nice day!** -->
合并状态:未合并 关闭于 2026-02-27 5 条评论