MartinThoma / openpyxl-stubs

Type stubs for openpyxl
MIT License
9 stars 9 forks source link

Add Worksheet.add_data_validation #25

Closed danvk closed 1 year ago

danvk commented 1 year ago

See https://openpyxl.readthedocs.io/en/stable/api/openpyxl.worksheet.worksheet.html?highlight=worksheet#openpyxl.worksheet.worksheet.Worksheet.add_data_validation

MartinThoma commented 1 year ago

@danvk CI is failing openpyxl-stubs/worksheet/worksheet.pyi:116: error: Name "DataValidation" is not defined

danvk commented 1 year ago

@MartinThoma added the missing import, we should be good now.

What threw me off was that worksheet.pyi already contained a referenced to DataValidationList without importing it:

https://github.com/MartinThoma/openpyxl-stubs/blob/b8bc5b5a0dae1d67a5455f5288fdf48bf7631965/openpyxl-stubs/worksheet/worksheet.pyi#L52

I see now that this is in implementation code, which I assume is ignored in .pyi file? Can it just be removed?

MartinThoma commented 1 year ago

Huh, intersting. Yes, I guess it could be removed.

Thank you for fixing it! And thank you for the PRs :heart:

MartinThoma commented 1 year ago

0.1.25 was just released with this fix