Skip to content

Lazy parsing of calendars#1201

Open
niccokunzmann wants to merge 45 commits intocollective:mainfrom
niccokunzmann:issue-1050-lazy-calendar
Open

Lazy parsing of calendars#1201
niccokunzmann wants to merge 45 commits intocollective:mainfrom
niccokunzmann:issue-1050-lazy-calendar

Conversation

@niccokunzmann
Copy link
Member

@niccokunzmann niccokunzmann commented Feb 16, 2026

Closes issue

Inspired by #1090

Description

  • move Component.from_ical into a class.
  • create subclass to re-parse components in case the calendar has timezone forward references

Checklist

  • I've added a change log entry to CHANGES.rst.
  • I've added or updated tests if applicable.
  • I've run and ensured all tests pass locally by following Run tests.
  • I've added or edited documentation, both as docstrings to be rendered in the API documentation and narrative documentation, as necessary.

📚 Documentation preview 📚: https://icalendar--1201.org.readthedocs.build/

@niccokunzmann niccokunzmann changed the base branch from issue-1050-lazy-calendar to main February 16, 2026 15:47
@coveralls
Copy link

coveralls commented Feb 16, 2026

Pull Request Test Coverage Report for Build 22078704268

Details

  • 265 of 278 (95.32%) changed or added relevant lines in 11 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.04%) to 98.053%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/icalendar/parser/ical/lazy.py 43 44 97.73%
src/icalendar/parser/ical/component.py 112 117 95.73%
src/icalendar/cal/lazy.py 25 32 78.13%
Totals Coverage Status
Change from base Build 22032008571: -0.04%
Covered Lines: 11541
Relevant Lines: 11762

💛 - Coveralls
@SashankBhamidi
Copy link
Member

Just saw this, I don't want #1050 to be closed, that'd effect my GitHub stats, can it be merged and worked upon?

@niccokunzmann
Copy link
Member Author

Yes, at some point, you could add some tests to this PR. I will not copy from your PR then, so you can add some of your stuff. Also, I wonder what you are optimizing for, not closing PRs, but that is not my business :)

@SashankBhamidi
Copy link
Member

SashankBhamidi commented Feb 22, 2026

Yes, at some point, you could add some tests to this PR. I will not copy from your PR then, so you can add some of your stuff. Also, I wonder what you are optimizing for, not closing PRs, but that is not my business :)

Oh wait, my bad, I meant #1090, I mis-read "Inspired" as "Closes" haha. Apologies.

Lmk when you want me to add stuff here and ready for review.

@niccokunzmann niccokunzmann marked this pull request as ready for review March 1, 2026 13:04
niccokunzmann and others added 13 commits March 17, 2026 17:58
Co-authored-by: Sashank <hello@sashank.wiki> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Sashank <hello@sashank.wiki>
Co-authored-by: Sashank <hello@sashank.wiki>
Co-authored-by: Sashank <hello@sashank.wiki>
Co-authored-by: Sashank <hello@sashank.wiki>
Co-authored-by: Sashank <hello@sashank.wiki>
@niccokunzmann
Copy link
Member Author

niccokunzmann commented Mar 17, 2026

@SashankBhamidi Thanks for the review. There are outstanding tasks

How should we go about this and the other PR. Would you want to PR it to this branch and we merge it into this one?

@SashankBhamidi
Copy link
Member

Thanks for the review. There are outstanding tasks

I'd prefer to keep #1090 open and rebase it on top once this merges. Can we agree on that path before I mark this approved?

@SashankBhamidi
Copy link
Member

@niccokunzmann I've left my comments on the tasks.

@niccokunzmann
Copy link
Member Author

I'd prefer to keep #1090 open and rebase it on top once this merges. Can we agree on that path before I mark this approved?

Yes, that sounds good.

@niccokunzmann
Copy link
Member Author

@SashankBhamidi @stevepiercy I believe, I addressed all your comments. Could you have a look again?

@SashankBhamidi
Copy link
Member

@niccokunzmann component.py has conflicts, I will review by EOD.

SashankBhamidi
SashankBhamidi previously approved these changes Mar 20, 2026
Copy link
Member

@SashankBhamidi SashankBhamidi left a comment

Choose a reason for hiding this comment

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

There's a duplicate return self._subcomponents.is_lazy() at lines 263-264 in cal/lazy.py, looks like it crept in during the edits. One of them needs to go.

Good work, thanks!

@niccokunzmann
Copy link
Member Author

niccokunzmann commented Mar 20, 2026

1bd35c0 addresses the duplicated statement

Merge?

Copy link
Member

@SashankBhamidi SashankBhamidi left a comment

Choose a reason for hiding this comment

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

LGTM, can be merged unless @stevepiercy has something to add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants