Skip to content

[python] treat timestamp of zero as equivalent to None#4071

Merged
bkmartinjr merged 4 commits intomainfrom
bkm/soma-72
May 21, 2025
Merged

[python] treat timestamp of zero as equivalent to None#4071
bkmartinjr merged 4 commits intomainfrom
bkm/soma-72

Conversation

@bkmartinjr
Copy link
Copy Markdown
Member

Issue and/or context:

Fixes SOMA-72

A timestamp value of zero is not a legal timestamp in TileDB. TileDB APIs treat None and 0 as equivalent to the default time of now. As of TileDB-SOMA 1.15 this package regressed and treated zero as a specific time, which will raise inscrutable errors in various code paths.

Changes:

A timestamp value of zero (int) or epoch (datetime.datetime) is equivalent to now.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.27%. Comparing base (6863821) to head (660eebc).
Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #4071       +/-   ##
===========================================
+ Coverage   65.28%   89.27%   +23.99%     
===========================================
  Files         160       59      -101     
  Lines       21323     7078    -14245     
  Branches     1259        0     -1259     
===========================================
- Hits        13920     6319     -7601     
+ Misses       6992      759     -6233     
+ Partials      411        0      -411     
Flag Coverage Δ
libtiledbsoma ?
python 89.27% <100.00%> (+0.29%) ⬆️

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

Components Coverage Δ
python_api 89.27% <100.00%> (+0.29%) ⬆️
libtiledbsoma ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bkmartinjr bkmartinjr marked this pull request as ready for review May 20, 2025 19:21
@bkmartinjr bkmartinjr requested review from jp-dark and ktsitsi May 20, 2025 19:22
Copy link
Copy Markdown
Collaborator

@ktsitsi ktsitsi left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Copy Markdown
Collaborator

@jp-dark jp-dark left a comment

Choose a reason for hiding this comment

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

The change here looks good, but we should also update our docstrings to call out this oddity around timestamp=0. If it doesn't go in this PR can you add an issue for that?

@bkmartinjr bkmartinjr merged commit d8a8ce4 into main May 21, 2025
31 of 42 checks passed
@bkmartinjr bkmartinjr deleted the bkm/soma-72 branch May 21, 2025 14:37
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