Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worksheet.row_dimensions type hinting does not work properly #11845

Open
JasonMendoza2008 opened this issue Apr 29, 2024 · 0 comments
Open

Worksheet.row_dimensions type hinting does not work properly #11845

JasonMendoza2008 opened this issue Apr 29, 2024 · 0 comments
Labels
stubs: false positive Type checkers report false errors

Comments

@JasonMendoza2008
Copy link

JasonMendoza2008 commented Apr 29, 2024

Openpyxl type-hinting Issue

Worksheet's row_dimensions raises a Warning when I put an integer in it (for the index of the row to change the height of) although it works (height is changed and script runs correctly).

MRE:

import openpyxl
from openpyxl.worksheet.worksheet import Worksheet

# Load an existing workbook or create a new one
wb = openpyxl.load_workbook('your_workbook.xlsx')
ws: Worksheet = wb.active

# Set the height of row 1 to 25
ws.row_dimensions[1].height = 25  <-- problem

# Save the changes back to the workbook
wb.save('your_workbook.xlsx')

I'm using Python 3.11.1 and the latest version of openpyxl (3.1.2).

enter image description here

Source of the problem: https://github.com/python/typeshed/tree/ff946a734909f62ec3880cf7c9bbbd0339914081/stubs/openpyxl

StackOverflow: https://stackoverflow.com/questions/78358388/worksheet-row-dimensions-type-hinting-does-not-work-properly

@Avasam Avasam added the stubs: false positive Type checkers report false errors label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stubs: false positive Type checkers report false errors
Projects
None yet
Development

No branches or pull requests

2 participants