Skip to content

Fix for #1677#1678

Merged
JrooTJunior merged 3 commits intoaiogram:dev-3.xfrom
andrew000:as_markup-mypy-fix
Apr 26, 2025
Merged

Fix for #1677#1678
JrooTJunior merged 3 commits intoaiogram:dev-3.xfrom
andrew000:as_markup-mypy-fix

Conversation

@andrew000
Copy link
Contributor

Fixes #1677

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • New and existing unit tests pass locally with my changes

@github-actions github-actions bot added the 3.x Issue or PR for stable 3.x version label Apr 22, 2025
@github-actions
Copy link

github-actions bot commented Apr 22, 2025

✔️ Changelog found.

Thank you for adding a description of the changes

@JrooTJunior JrooTJunior requested a review from Copilot April 22, 2025 09:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issue #1677 by replacing the conditional type checking implementations with runtime definitions of as_markup in both InlineKeyboardMarkup and ReplyKeyboardMarkup cases.

  • Removed TYPE_CHECKING blocks around as_markup methods.
  • Now as_markup methods explicitly cast the result of super().as_markup, ensuring runtime functionality.
Files not reviewed (1)
  • CHANGES/1677.misc.rst: Language not supported

@codecov
Copy link

codecov bot commented Apr 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (eb84458) to head (f5b8031).
Report is 2 commits behind head on dev-3.x.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           dev-3.x     #1678   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          568       568           
  Lines        13337     13341    +4     
=========================================
+ Hits         13337     13341    +4     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
aiogram/utils/keyboard.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes bug #1677 by ensuring the as_markup methods in both InlineKeyboardBuilder and ReplyKeyboardBuilder properly forward calls to their parent implementations.

  • Removed TYPE_CHECKING blocks that previously provided only stub implementations
  • Added runtime implementations for as_markup with appropriate docstrings
Files not reviewed (1)
  • CHANGES/1677.misc.rst: Language not supported

@JrooTJunior JrooTJunior merged commit 482629a into aiogram:dev-3.x Apr 26, 2025
23 checks passed
@andrew000 andrew000 deleted the as_markup-mypy-fix branch April 26, 2025 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x Issue or PR for stable 3.x version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MyPy [return-value] error in InlineKeyboardBuilder().as_markup()

3 participants