Repository navigation
Show no timestamp instead of "None" for a sample without one - #285
Merged
danielplohmann merged 2 commits intoOct 16, 2026
Merged
Conversation
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.
This was referenced Oct 13, 2026
Collaborator
Author
|
@danielplohmann, could this one be merged before the other open PRs? CI installs the newest mcrit ( 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.
This was referenced Oct 13, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 thedatefilter, 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.pyswaps outrequestsunderneath a realMcritClient, and since mcrit 1.15.0 the client sends through arequests.Session()it opens itself. The stub had noSession, 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.pyis new. It checks thedatefilter, 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 ownSampleEntry.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).