Skip to content

chore: replace deprecated lazy='noload' in SQL storage models - #2274

Merged
vdusek merged 1 commit into
masterfrom
chore/replace-noload
Oct 5, 2026
Merged

vdusek merged 1 commit into
masterfrom
chore/replace-noload

Conversation

@vdusek

@vdusek vdusek commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

SQLAlchemy 2.1 deprecates the noload loader strategy, so the four relationships in the SQL storage models raised SADeprecationWarning for users on 2.1. They now use lazy='raise', passive_deletes=True.

Nothing reads these relationships, and the SQL clients delete rows with Core delete() statements, relying on the FK ondelete='CASCADE'. The SQL tests pass on SQLAlchemy 2.1.3 with the deprecation warning turned into an error, and on 2.0.54.

Closes: #2272

✍️ Drafted by Claude Code

@vdusek vdusek added the t-tooling Issues with this label are in the ownership of the tooling team. label Oct 5, 2026
@vdusek vdusek self-assigned this Oct 5, 2026
@vdusek vdusek added the t-tooling Issues with this label are in the ownership of the tooling team. label Oct 5, 2026
@codecov

codecov Bot commented Oct 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.90%. Comparing base (87561ee) to head (7db9614).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2274   +/-   ##
=======================================
  Coverage   93.90%   93.90%           
=======================================
  Files         182      182           
  Lines       13144    13144           
=======================================
  Hits        12343    12343           
  Misses        801      801           
Flag Coverage Δ
unit 93.90% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek
vdusek requested a review from Mantisus October 5, 2026 14:34
@vdusek
vdusek marked this pull request as ready for review October 5, 2026 14:34

@Mantisus Mantisus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@B4nan

B4nan commented Oct 5, 2026

Copy link
Copy Markdown
Member

@Mantisus I've tried to set up a GH app that should approve based on your PR approvals, so please try to approve again so we can test it.

@Mantisus Mantisus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@apify-approval-mirror apify-approval-mirror Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Mirroring approval from @Mantisus.

@B4nan

B4nan commented Oct 5, 2026

Copy link
Copy Markdown
Member

ok, seems to be working, i just had to adjust the app permissions a bit

@vdusek
vdusek merged commit fa95976 into master Oct 5, 2026
70 of 71 checks passed
@vdusek
vdusek deleted the chore/replace-noload branch October 5, 2026 16:55
vdusek added a commit that referenced this pull request Oct 5, 2026
…er clock (#2275)

`test_static_handler_raised_throttled_error_is_deferred` failed on macOS
([run](https://github.com/apify/crawlee-python/actions/runs/37274209355/job/111647535443)).
The test put the domain into a 50 ms backoff and raised
`RequestThrottledError`. The crawler defers the request only if
`is_throttled()` still holds when it checks, and on a loaded runner the
backoff ran out first. The request then went down the ordinary-error
path and fell back to the browser.

A new helper, `open_throttler_held_until_reclaim()` in
`tests/unit/utils.py`, opens the throttler on a stopped `Mock` clock
with a 1-minute backoff. The domain is always still held back when the
crawler checks. When the crawler reclaims the deferred request, the
clock moves past the backoff, so the retry is dispatched right away.

The same race also failed
`test_handler_raised_throttled_error_is_deferred` in the basic crawler
suite
([run](https://github.com/apify/crawlee-python/actions/runs/37325111977/job/111813759733),
on #2274).

Six deferral tests in the basic, HTTP, Playwright and adaptive crawler
suites now use the helper. Their assertions are unchanged, and all of
them fail when `_is_held_back` is forced to `False`. The stall tests
still use the 50 ms backoff, since they need real time to pass through
`max_domain_stall`.

Closes: #2271

*✍️ Drafted by Claude Code*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace deprecated lazy='noload' in SQL storage models

4 participants