Skip to content

docs: explain comparison and sorting of Arrow objects - #1363

Open
x0Lazarus wants to merge 1 commit into
arrow-py:masterfrom
x0Lazarus:docs/comparison-guide
Open

x0Lazarus wants to merge 1 commit into
arrow-py:masterfrom
x0Lazarus:docs/comparison-guide

Conversation

@x0Lazarus

Copy link
Copy Markdown

Description of Changes

The guide does not explain that Arrow objects support equality, ordering and sorting, leaving their timezone behavior unclear. Add a Compare section after Properties, as suggested in #981.

The examples show equal instants with different offsets, sorting, and comparisons with datetime objects. The text explains that Arrow follows Python's datetime rules, including the repeated-hour case where comparing local times ignores fold. A short example shows how converting to UTC distinguishes those instants.

Validation on Windows with Python 3.12: all 14 new example statements pass doctest; the full suite passes with 1,901 tests and one existing platform skip; all configured pre-commit hooks pass; doc8 and the Sphinx HTML build with warnings treated as errors pass. Other Python versions and operating systems were not tested locally. No library code changes.

Closes #981.

Pull Request Checklist

  • Added tests for changed code. Not applicable: documentation only; the new examples were executed with doctest.
  • All tests pass when run locally, with the existing Windows negative-timestamp skip noted above.
  • All linting checks pass when run locally.
  • Updated documentation.
  • Code is up-to-date with the master branch.

@codecov

codecov Bot commented Sep 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2224255) to head (db7031a).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1363   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         2315      2315           
  Branches       358       358           
=========================================
  Hits          2315      2315           

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

This branch has not been deployed

No deployments
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.

Documentation doesn't mention comparison

1 participant