Skip to content

Show no timestamp instead of "None" for a sample without one - #285

Merged
danielplohmann merged 2 commits into
familiary:masterfrom
r0ny123:fix/sample-without-timestamp
Oct 16, 2026
Merged

danielplohmann merged 2 commits into
familiary:masterfrom
r0ny123:fix/sample-without-timestamp

Conversation

@r0ny123

@r0ny123 r0ny123 commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

A sample submitted without a timestamp has none, and MCRITweb printed it as "None". MCRIT stores such a sample's timestamp as null. Once MCRIT reads it back as None (the familiary/mcrit PR from r0ny123:fix/sample-search-sort), the start page's latest samples, through the date filter, and the query sample page show "None" where the timestamp goes. Both now leave the cell blank.

The other change is in the tests. tests/testSubmitMetadata.py swaps out requests underneath a real McritClient, and since mcrit 1.15.0 the client sends through a requests.Session() it opens itself. The stub had no Session, so all 8 tests in that file errored on master. The stub now hands back itself as the session, which changes nothing for an older client.

Tests: tests/testSampleTimestamp.py is new. It checks the date filter, the query sample page and the start page with a sample that has no timestamp, and every case fails without the fix. The start page reads samples with mcrit's own SampleEntry.fromDict, which fails on a missing timestamp until a release carries the MCRIT fix, so that test skips itself, and says why, on older mcrit. The full suite passes against released mcrit 1.15.0 (1260 passed, 8 skipped) and against mcrit with the fix (1261 passed, 7 skipped).

MCRIT stores the timestamp of a sample submitted without one as null,
and reads it back as None once it can read such a sample at all. The
date filter and the query sample page printed that as "None"; both now
leave it blank.

The submit metadata tests stub out requests under a real McritClient.
Since mcrit 1.15.0 the client sends through a requests.Session() it
opens itself, which the stub lacked, so all 8 tests errored. The stub
now hands back itself as the session.
The start page reads samples with mcrit's SampleEntry.fromDict, which
fails on a missing timestamp in releases without familiary/mcrit#272,
so CI on released mcrit failed the test. It now skips, naming why, until
the installed mcrit reads such a sample.
r0ny123 added a commit that referenced this pull request Oct 13, 2026
mcrit 1.15.0, which CI now installs, makes McritClient send through a
requests.Session() it opens in its constructor. The test swaps the
client's requests module for a stub with get and post only, so creating
the client raised AttributeError and all eight tests in the file
errored. The stub now hands itself back as the session. Same change as
in #285; it works with 1.13 and 1.15.
@r0ny123

r0ny123 commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator Author

@danielplohmann, could this one be merged before the other open PRs?

CI installs the newest mcrit (requirements.txt asks for >=1.12.0), and mcrit 1.15.0's McritClient opens a requests.Session() in its constructor. The stub in tests/testSubmitMetadata.py has no Session, so all eight tests in that file error. That happens on master too: its last green run was before 1.15.0. Every PR whose CI runs again without this change goes red on those eight tests, whatever it changes itself.

This PR carries the fix (the stub hands itself back as the session); it is green here, and the file passes against mcrit 1.13.0 and 1.15.0. I copied the same change into #273, #283 and #286 to #290 to keep them green, where it becomes a no-op once this is on master.

r0ny123 added a commit that referenced this pull request Oct 13, 2026
mcrit 1.15.0, which CI now installs, makes McritClient send through a
requests.Session() it opens in its constructor. The test swaps the
client's requests module for a stub with get and post only, so creating
the client raised AttributeError and all eight tests in the file
errored. The stub now hands itself back as the session. Same change as
in #285; it works with 1.13 and 1.15.
r0ny123 added a commit that referenced this pull request Oct 13, 2026
mcrit 1.15.0, which CI now installs, makes McritClient send through a
requests.Session() it opens in its constructor. The test swaps the
client's requests module for a stub with get and post only, so creating
the client raised AttributeError and all eight tests in the file
errored. The stub now hands itself back as the session. Same change as
in #285; it works with 1.13 and 1.15.
r0ny123 added a commit that referenced this pull request Oct 13, 2026
mcrit 1.15.0, which CI now installs, makes McritClient send through a
requests.Session() it opens in its constructor. The test swaps the
client's requests module for a stub with get and post only, so creating
the client raised AttributeError and all eight tests in the file
errored. The stub now hands itself back as the session. Same change as
in #285; it works with 1.13 and 1.15.
@danielplohmann
danielplohmann merged commit 7a10669 into familiary:master Oct 16, 2026
4 checks passed
danielplohmann added a commit that referenced this pull request Oct 16, 2026
r0ny123 added a commit to r0ny123/mcritweb that referenced this pull request Oct 19, 2026
mcrit 1.15.0, which CI now installs, makes McritClient send through a
requests.Session() it opens in its constructor. The test swaps the
client's requests module for a stub with get and post only, so creating
the client raised AttributeError and all eight tests in the file
errored. The stub now hands itself back as the session. Same change as
in familiary#285; it works with 1.13 and 1.15.
r0ny123 added a commit to r0ny123/mcritweb that referenced this pull request Oct 19, 2026
mcrit 1.15.0, which CI now installs, makes McritClient send through a
requests.Session() it opens in its constructor. The test swaps the
client's requests module for a stub with get and post only, so creating
the client raised AttributeError and all eight tests in the file
errored. The stub now hands itself back as the session. Same change as
in familiary#285; it works with 1.13 and 1.15.
r0ny123 added a commit to r0ny123/mcritweb that referenced this pull request Oct 19, 2026
mcrit 1.15.0, which CI now installs, makes McritClient send through a
requests.Session() it opens in its constructor. The test swaps the
client's requests module for a stub with get and post only, so creating
the client raised AttributeError and all eight tests in the file
errored. The stub now hands itself back as the session. Same change as
in familiary#285; it works with 1.13 and 1.15.
r0ny123 added a commit to r0ny123/mcritweb that referenced this pull request Oct 19, 2026
mcrit 1.15.0, which CI now installs, makes McritClient send through a
requests.Session() it opens in its constructor. The test swaps the
client's requests module for a stub with get and post only, so creating
the client raised AttributeError and all eight tests in the file
errored. The stub now hands itself back as the session. Same change as
in familiary#285; it works with 1.13 and 1.15.
r0ny123 added a commit to r0ny123/mcritweb that referenced this pull request Oct 19, 2026
mcrit 1.15.0, which CI now installs, makes McritClient send through a
requests.Session() it opens in its constructor. The test swaps the
client's requests module for a stub with get and post only, so creating
the client raised AttributeError and all eight tests in the file
errored. The stub now hands itself back as the session. Same change as
in familiary#285; it works with 1.13 and 1.15.
r0ny123 added a commit that referenced this pull request Oct 19, 2026
README: master folded the older unreleased lines into its 1.6.0 entry,
so only this branch's own line stays above it. tests/testSubmitMetadata.py
is master's: #297 fixes the stub for mcrit 1.16.0, which replaces the
1.15.0 fix this branch carried from #285.
r0ny123 added a commit that referenced this pull request Oct 19, 2026
…t-in-worker

#268 now carries master's batch C1. tests/testSubmitMetadata.py is
master's: #297 fixes the stub for mcrit 1.16.0, which replaces the
1.15.0 fix this branch carried from #285.
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.

2 participants