Repository navigation
FIX: Load an updated data file only when it was published later - #282
Draft
jwrosewell wants to merge 1 commit into
Draft
jwrosewell wants to merge 1 commit into
jwrosewell wants to merge 1 commit into
Conversation
When a watched file changes or a download finishes, the data update service reads the published date in the new file's header, where the engine offers get_date_published_from_file, and loads the file only when that date is a later day than the data in use. A file that is not newer is left alone and the check is reported as AUTO_UPDATE_NOT_NEEDED. A download is compared before it replaces the data file, and is deleted when it is not newer. The Device Detection and IP Intelligence on-premise engines read the date through the native getPublishedTimeFromFile. Their watcher tests and update examples now expect a copy of the same file to be reported as not needed. Closes #280
This was referenced Nov 24, 2026
Draft
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.
Closes #280.
Why
The data updates specification says, under newFileAvailable, that a watched or downloaded file that is not newer is not loaded, and that the check is reported as not needed. The update service did not read the date in the file, so an older data file copied into place, with a newer modification time, was loaded over newer data.
What changes
datafile_update_service.pyanddatafile.pyinfiftyone_pipeline_engines: when a watched file changes or a download finishes, the service asks the data file's engine forget_date_published_from_file. Where the engine has it, the new file is loaded only when the published date in its header is a later day than the date of the data in use. Otherwise the engine keeps its data, the check is reported asAUTO_UPDATE_NOT_NEEDED, and the next check is scheduled as usual.AUTO_UPDATE_UNKNOWN_ERROR. An engine without the method, a cloud engine for example, has its files loaded as before, andIf-Modified-Sinceis sent as before.DeviceDetectionOnPremiseandIpIntelligenceOnPremisegainget_date_published_from_file, which calls the nativegetPublishedTimeFromFileofEngineHashSwigandEngineIpiSwig.AUTO_UPDATE_NOT_NEEDED.Tests
tests/test_datafile_published_date.py(new) uses a stand-in engine, so it needs no native library. It covers a later, the same and an earlier published date, for a watched file and for a download, and an earlier file with a newer modification time. Those cases fail against rc's update service and pass here.fiftyone_pipeline_enginespass on Python 3.14 with pytest 9.2 and-W error, leaving out the pytest collection warning forTestCacheintests/test_engines.pythat rc already gives.Before this leaves draft
Not ready to merge until these are done.
getPublishedTimeFromFile, is in cxx rc, thecxxsubmodule moves to it, and the SWIG wrappers are generated again here. Until then the two engine methods fail, and every watched or downloaded file for those engines is reported as an error. The free-threaded Python jobs show this at 1f4e47f (run 45488870092): bothtest_watcher_without_licence_key.pytests getAUTO_UPDATE_UNKNOWN_ERROR, asEngineHashSwigandEngineIpiSwighave nogetPublishedTimeFromFileyet, and every other test passes.AUTO_UPDATE_UNKNOWN_ERRORand loads nothing. With no data loaded yet, .NET and Java load the file, where this compares a download with the file already at the data file path. For a header with no date, .NET never loads the file and Java loads it, where the native engines here raise an error. The errors table may need a row for a header that cannot be read, and the method needs one name across the languages.