Repository navigation
Raise with a message when reading a value that has no value and no reason - #134
Merged
Merged
Conversation
…message The Null values section of properties.md says reading a value that is not set throws with a message explaining why. With no reason given the value raised Exception(None), whose message is 'None'.
…e and no reason value() raised Exception(None) when no reason was given. It now raises with NO_VALUE_MESSAGE, This instance does not have a set value, the message .NET and PHP use. no_value_message() is unchanged, so the JSON builder still writes Unknown as the null reason in that case.
This was referenced Nov 14, 2026
Draft
jwrosewell
marked this pull request as ready for review
November 15, 2026 04:02
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.
Reading
value()of anAspectPropertyValuethat has no value and no reason raisedException(None), whose message is "None", and an empty reason gave an empty message. The specification says the exception explains why the value is not set, so it now raises with "This instance does not have a set value" in those cases, the message .NET and PHP use.What the specification says
properties.md, Null values, at 6570727d:
.NET's
AspectPropertyValuedefaults itsNoValueMessageto "This instance does not have a set value" (AspectPropertyValue.cslines 47 and 48 at bb1b5c7a).What was found
At
rccf904f8,aspectproperty_value.pyline 80 raisedException(self.no_value_message()), soAspectPropertyValue()raised an exception whose message is "None". The specification's "customizable" part was already there, as a reason given to the constructor is the message.What changed
Files are linked at the head, c7e8e960.
aspectproperty_value.pygains the module constantNO_VALUE_MESSAGE, andvalue()raises withno_value_message()or, when that isNoneor empty, withNO_VALUE_MESSAGE.no_value_message()is unchanged and still givesNonewhen no reason was given, so the JSON builder still writes "Unknown" as the null reason in that case (jsonbundler.pylines 88 and 89).The test,
pipeline/fiftyone_pipeline_core/tests/test_aspectproperty_value.py, readsvalue()with no reason, aNonereason, an empty reason and a reason, expecting each to raise with the right message, checks thatno_value_message()staysNonewith no reason, and reads back each value that is set, includingNone,False,0, the empty string and a list.Runs
Each throwaway run gives every package a version as
ci/write-package-versions.ps1does and runs the core package's tox environment, on Ubuntu with Python 3.10 and 3.14.rccf904f8 and the throwaway workflow. With both versions "3 failed, 484 passed", the three being no reason and aNonereason, which raised with "None", and an empty reason, which raised with "".tmp/pr-matrix-134, success on its second attempt. Configure, all ten Build and Test jobs (Ubuntu and Windows, Python 3.10 to 3.14) and Complete are green. All 11Setting 'PullRequestSha'lines name the head c7e8e960, and Configure printed "Left out 5 macOS entries". The first attempt failed only in the Ubuntu Python 3.13 job, where the shared Selenium contract testExample_RendersClientSideOverridesOnThePagecould not start its browser driver ("Driver service process exited unexpectedly before initialization completed"), and that job alone was run again. That fault is in the shared Selenium contract tests, which selenium-api-tests#28 addresses by starting each browser once, with a longer limit, before the first test that uses it, and selenium-api-tests#31 tracks the 60 second limit every later session keeps.tmp/pr-matrix-134c, on the same head againstrcat cf520fe, which holds this week's other changes, success on its first attempt. All ten Build and Test jobs (Ubuntu and Windows, Python 3.10 to 3.14) and Complete are green,test_aspectproperty_value.pypasses in each, all 11Setting 'PullRequestSha'lines name c7e8e96, and Configure printed "Left out 5 macOS entries".macOS was left out of this draft's full build under the 9 November decision. The rc head is built with macOS before it merges into main.
Before you upgrade
Code that catches the exception
value()raises with no value and reads its message gets "This instance does not have a set value" where it got "None" before, when no reason was given.What remains
AspectPropertyValuestill treats the string "noValue" passed as the value as no value, because the constructor uses it as the default for "no value given". Changing that changes the constructor, and is not done here. #155 tracks it.