fix: Ensure uint64 fields are handled correctly in _create_dataset#791
Merged
tchaton merged 10 commits intoLightning-AI:mainfrom Feb 18, 2026
Merged
Conversation
…reate_dataset The SDK bump in Lightning-AI#783 switched to DatasetServiceCreateDatasetBody and added `or ""` fallbacks for all fields. This is valid for string fields but version is a uint64 in protobuf, so "" causes a 400 Bad Request when saving to Lightning storage. Revert to passing None for version when no value is provided, matching the pre-bump behaviour.
_create_dataset_create_dataset
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #791 +/- ##
====================================
+ Coverage 80% 81% +1%
====================================
Files 52 53 +1
Lines 7386 7565 +179
====================================
+ Hits 5920 6112 +192
+ Misses 1466 1453 -13 🚀 New features to boost your workflow:
|
tchaton
approved these changes
Feb 18, 2026
4 tasks
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.
Before submitting
What does this PR do?
Main Change - utilities.py
The SDK bump in #783 switched to
DatasetServiceCreateDatasetBodyand addedor ""fallbacks for updated fields. This was incorrect - these were changed to be uint64 in the backend, where "" isn't valid.Sidenote: Protobuf generation maps unit64 to string in client models for JS precision reasons (whereas uint32 can be safely represented as an int). I guess this decision also impacted the python generation.
Anyway. This PR ensures we pass None for unit64 fields when no value is provided, which makes the value not set in the request and avoids 400 responses. This matches the pre-bump behaviour.
Other change - requirements utiltiies
The build was breaking due to issues pulling in the
pkg_resourcesdependency. Thomas added some commits to fix this, by vendoringimports.pyfrom thelightning-utilitiespackage.I added some auto-generated tests so codecov could pass.
Other change - Windows lock file clean-up fixes
Pins the version of lockfile so that the lock files are properly cleaned up on Windows, and so that the tests pass. More detial is explained in this PR, which may get closed in due course: #792
I'll see in the background if I can solve the issues on that PR and unpin lockfile. But I think pinning is OK.
Testing
I tested this locally by:
pip install "setuptools<82" && pip install -e . --no-build-isolationto install litData locallypip install --upgrade lightning_sdkoptimizewith atarget_dirpointing at Lightning storage from a Lightning AI studioTest script:
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃