目录
Dmitry Kalinkin

fix: recover handling of typing.Optional[X] (#90)

This fixes downstream bug https://github.com/bouweandela/snakemake-storage-plugin-rucio/issues/41 which prevented type.Optional[int] settings from performing a type conversion.

Turns out that was a regression from https://github.com/snakemake/snakemake-interface-common/pull/59 @jjjermiah

typing.Union[X] is not instance of type. The logic of the function is about checking the type of value, so specifying a narrow annotation forces duplicating function logic around its calls.

Summary by CodeRabbit

  • Bug Fixes

  • Improved error handling for type conversions in plugin settings with clearer, descriptive user-facing errors when conversion fails.

  • Refactor

  • Broadened plugin type handling to accept more complex type representations and enforce valid Union usage (disallowing non-Optional unions).

  • Tests

  • Added tests covering integer conversion and Optional[int] handling for plugin settings, plus example plugin/settings scaffolding.


Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) aider@aider.chat Co-authored-by: Johannes Köster johannes.koester@uni-due.de

1个月前179次提交

snakemake-interface-common

Common functions and classes for Snakemake and its plugins.

关于

为Snakemake工作流管理系统提供通用接口和共享功能

400.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号