Skip to content

Release v0.3.58#251

Merged
bradhe merged 4 commits intomainfrom
develop
Apr 17, 2026
Merged

Release v0.3.58#251
bradhe merged 4 commits intomainfrom
develop

Conversation

@sammuti
Copy link
Copy Markdown
Contributor

@sammuti sammuti commented Apr 16, 2026

  • Development workflow improvements
  • Upgrade Iceberg versions
  • Retries on inserts and deletes on the Iceberg side
  • Bump version to v0.3.58

Summary by CodeRabbit

  • New Features

    • Insert and delete operations now support automatic retry on transaction conflicts with configurable retry attempts and delay.
  • Improvements

    • Iceberg reads now use a pyiceberg-backed reader for better compatibility.
    • URL handling improved to prefer HTTPS for non-local hosts.
    • Relaxed dependency constraints to allow newer package versions.
  • Tests

    • Added concurrency tests validating retry and refresh behavior for inserts and deletes.
  • Chores

    • Project version bumped.

socksy and others added 2 commits April 13, 2026 14:29
When logging in with an http:// URL against a remote server, reqwest
silently downgrades POST to GET on 301/302 redirects (per RFC 7231),
causing subsequent commands like `tower teams switch` to fail with 404.
…249)

* [TOW-1836] Upgrade iceberg version and dependancies to latest stable

* set versions as minimums
@sammuti sammuti requested a review from bradhe April 16, 2026 14:18
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 14805e90-8628-49e1-8a8f-a4344204cb94

📥 Commits

Reviewing files that changed from the base of the PR and between f078f3a and b458384.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml
  • pyproject.toml
✅ Files skipped from review due to trivial changes (1)
  • Cargo.toml

📝 Walkthrough

Walkthrough

Normalize persisted tower URLs (convert http→https for non-local hosts), switch Polars Iceberg scans to a pyiceberg-backed reader, add configurable retry-and-refresh loops for Iceberg table inserts/deletes, bump workspace/python package versions and iceberg-related dependency constraints, and add concurrency tests for retry behavior.

Changes

Cohort / File(s) Summary
URL Normalization
crates/tower-cmd/src/session.rs
finalize_session now clones config.tower_url, detects local hosts (localhost, 127.0.0.1, ::1), and if non-local and scheme is http attempts to switch the scheme to https before persisting to session.tower_url.
Dependency & Version Bumps
pyproject.toml, Cargo.toml
Workspace/package version bumped to 0.3.58; Python iceberg-related extras changed from exact pins to minimum-version constraints (polars>=1.39.3, pyarrow>=23.0.1, pyiceberg>=0.11.1) and dev group updated similarly.
Retry Logic & Reader Integration
src/tower/_tables.py
Table.read() and Table.to_polars() now call pl.scan_iceberg(..., reader_override="pyiceberg"). Added Table._validate_retry_args(...). Table.insert(...) and Table.delete(...) signatures now accept max_retries and retry_delay_seconds and implement retry loops that refresh metadata on CommitFailedException, sleep between attempts, and re-raise after exhaustion.
Concurrency Tests & Schema Tweaks
tests/tower/test_tables.py
Added concurrent insert/delete tests that simulate commit conflicts by mocking failures and asserting refresh calls and final table state; changed retries field to pa.int32() and relaxed map-type null representation assertion.

Sequence Diagram(s)

sequenceDiagram
  participant Client as Client
  participant TableAPI as Table.insert()/delete()
  participant Iceberg as IcebergTable (append/delete)
  participant Catalog as Catalog.refresh()

  Client->>TableAPI: call insert/delete(data, max_retries, delay)
  TableAPI->>Iceberg: attempt append/delete
  alt CommitFailedException
    Iceberg-->>TableAPI: raises CommitFailedException
    TableAPI->>Catalog: refresh()
    TableAPI->>TableAPI: sleep(retry_delay_seconds)
    TableAPI->>Iceberg: retry append/delete (repeat up to max_retries)
  else Success
    Iceberg-->>TableAPI: success (commit)
  end
  TableAPI-->>Client: return final result or raise last exception
Loading

Possibly related PRs

Suggested reviewers

  • jo-sm
  • codingcyclist
  • konstantinoscs
  • giray123
  • socksy

Poem

🐰 I hopped through URL schemes and retried each row,

Refreshing the garden where CommitFailed winds blow.
Polars met pyiceberg, dependencies light and spry,
Threads danced in chorus, no conflict left to fry.
Huzzah — tables settle; I munch a carrot—bye-bye!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 59.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title "Release v0.3.58" directly reflects the main purpose of the pull request, which is to release version 0.3.58 as evidenced by version bumps across multiple files (Cargo.toml, pyproject.toml) and associated changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Comment @coderabbitai help to get the list of available commands and usage tips.

* Add commit retries to insert and delete table writes

Parallel writes to the same Iceberg table can fail with
CommitFailedException when the branch changes during active writes.
This adds the same retry-with-refresh logic that upsert already has
to both insert() and delete(), resolving concurrent write conflicts
automatically.

* Address PR #250 feedback: validate retry args and make tests deterministic

Add input validation for max_retries and retry_delay_seconds across
insert(), upsert(), and delete() to prevent confusing errors from
negative values. Make concurrent insert/delete tests deterministic by
forcing CommitFailedException on the first attempt rather than relying
on real concurrency conflicts.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pyproject.toml (1)

7-7: ⚠️ Potential issue | 🟡 Minor

Version mismatch: 0.3.57 vs PR title v0.3.58.

The project version in pyproject.toml is 0.3.57, but the PR title indicates this is a release for v0.3.58. Consider bumping the version to match.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pyproject.toml` at line 7, The project version in pyproject.toml is still set
to version = "0.3.57" but the PR title indicates release v0.3.58; update the
version string in pyproject.toml to "0.3.58" (i.e., change the value of the
version key) so the package metadata matches the intended release.
🧹 Nitpick comments (1)
src/tower/_tables.py (1)

29-30: Remove unused random import.

The random module is imported but never used in this file.

🧹 Proposed fix
 import time
-import random
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/tower/_tables.py` around lines 29 - 30, Remove the unused import by
deleting the `random` import statement from the top of the module (currently
`import random`) so only used modules like `time` remain; update any import
grouping or formatting if needed and run linters to confirm no other unused
imports remain in the file (`src/tower/_tables.py`).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@pyproject.toml`:
- Line 7: The project version in pyproject.toml is still set to version =
"0.3.57" but the PR title indicates release v0.3.58; update the version string
in pyproject.toml to "0.3.58" (i.e., change the value of the version key) so the
package metadata matches the intended release.

---

Nitpick comments:
In `@src/tower/_tables.py`:
- Around line 29-30: Remove the unused import by deleting the `random` import
statement from the top of the module (currently `import random`) so only used
modules like `time` remain; update any import grouping or formatting if needed
and run linters to confirm no other unused imports remain in the file
(`src/tower/_tables.py`).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3816023e-e898-4074-97db-268e50a6195b

📥 Commits

Reviewing files that changed from the base of the PR and between 824944b and f078f3a.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • crates/tower-cmd/src/session.rs
  • pyproject.toml
  • src/tower/_tables.py
  • tests/tower/test_tables.py

* Version bump to 0.3.58

* uv lock
@bradhe bradhe merged commit 500bd96 into main Apr 17, 2026
32 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants