You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Signature::name is None, the accessor method returns filename() and then md5sum() instead of an empty string, "".
This causes problems because (e.g.) Record::from_sig uses name() to construct the Record, but then this causes PartialEq to fail to match records that have empty names and are built elsewhere. This is what is causing intersect_manifest to fail over in sourmash-bio/sourmash_plugin_branchwater#538 with standalone manifests built with empty names.
In #3434, I propose having an empty name return empty string instead.
Alternatives would be to provide a different accessor function (raw_name()?) or has_name() or something. But since no tests seem to depend on the current behavior, and nothing breaks, I think it's ok to change.
(The inspiration from this behavior was from the Python layer, where we provide a display name.)
The text was updated successfully, but these errors were encountered:
… `filename()` and `md5sum()` (#3434)
This PR adjusts `Signature::name()` to return `None` when no name is
set, instead of returning first `filename()` or (if empty) `md5sum()`.
It also adds `name_str()` which returns an empty string, to avoid too
many `unwrap_or` scattered throughout the codebase.
Fixes#3441
When
Signature::name
isNone
, the accessor method returnsfilename()
and thenmd5sum()
instead of an empty string,""
.This causes problems because (e.g.)
Record::from_sig
usesname()
to construct theRecord
, but then this causesPartialEq
to fail to match records that have empty names and are built elsewhere. This is what is causingintersect_manifest
to fail over in sourmash-bio/sourmash_plugin_branchwater#538 with standalone manifests built with empty names.In #3434, I propose having an empty name return empty string instead.
Alternatives would be to provide a different accessor function (
raw_name()
?) orhas_name()
or something. But since no tests seem to depend on the current behavior, and nothing breaks, I think it's ok to change.(The inspiration from this behavior was from the Python layer, where we provide a display name.)
The text was updated successfully, but these errors were encountered: