Skip to content

Comments

Fix geojson_type click option implementation#3391

Merged
snowman2 merged 1 commit intorasterio:mainfrom
QuLogic:fix-geojson-type
Nov 6, 2025
Merged

Fix geojson_type click option implementation#3391
snowman2 merged 1 commit intorasterio:mainfrom
QuLogic:fix-geojson-type

Conversation

@QuLogic
Copy link
Contributor

@QuLogic QuLogic commented Sep 7, 2025

According to several issues upstream (e.g., [1], [2]), creating multiple options that save to the same destination is not documented or supported. Somewhere in 8.2.x, this also broke, as it depended on evaluation order in some way.

Instead, save the options to different name, and use a callback function on all of them to verify that the result is exclusive, and follows the default.

[1] pallets/click#1688 (comment)
[2] pallets/click#2321 (comment)

@QuLogic
Copy link
Contributor Author

QuLogic commented Sep 7, 2025

I rebased on top of #3393 so that tests pass, but think this will only be necessary with click 8.3.

@snowman2 snowman2 added the bug label Sep 11, 2025
@snowman2 snowman2 added this to the 1.4.4 milestone Sep 11, 2025
According to several issues upstream (e.g., [1], [2]), creating multiple
options that save to the same destination is not documented or
supported. Somewhere in 8.2.x, this also broke, as it depended on
evaluation order in some way.

Instead, save the options to different name, and use a callback function
on all of them to verify that the result is exclusive, and follows the
default.

[1] pallets/click#1688 (comment)
[2] pallets/click#2321 (comment)
@w8sl
Copy link
Contributor

w8sl commented Oct 9, 2025

👍 Must have now, with click 8.3

@snowman2 snowman2 merged commit ef60803 into rasterio:main Nov 6, 2025
26 checks passed
@snowman2
Copy link
Member

snowman2 commented Nov 6, 2025

Thanks @QuLogic 👍

@snowman2 snowman2 added the backport-1.4 To be backported to maint-1.4 label Nov 6, 2025
snowman2 pushed a commit that referenced this pull request Nov 6, 2025
According to several issues upstream (e.g., [1], [2]), creating multiple
options that save to the same destination is not documented or
supported. Somewhere in 8.2.x, this also broke, as it depended on
evaluation order in some way.

Instead, save the options to different name, and use a callback function
on all of them to verify that the result is exclusive, and follows the
default.

[1] pallets/click#1688 (comment)
[2] pallets/click#2321 (comment)
@QuLogic QuLogic deleted the fix-geojson-type branch November 20, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-1.4 To be backported to maint-1.4 bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants