-
Notifications
You must be signed in to change notification settings - Fork 13
Determine sample name length limit from server capability #614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds dynamic enforcement of sample name length limits based on server capabilities, with a fallback to the legacy truncation behavior for older servers.
- Fetch and apply the server-reported maximum title length in the client before running queries
- Introduce an async adapter method to parse
long_sample_titles_NNNNcapabilities - Replace the hard-coded 512-char truncation with runtime validation and a 128-char fallback
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| servicex/servicex_client.py | Call get_servicex_sample_title_limit and run validate_title on each sample |
| servicex/servicex_adapter.py | Add get_servicex_sample_title_limit and a _sample_title_limit attribute |
| servicex/databinder_models.py | Replace static truncation with validate_title(length) enforcing limits |
Comments suppressed due to low confidence (3)
servicex/databinder_models.py:146
- The
lengthparameter can beNonein the fallback case, so the annotation should beOptional[int]to match the actual behavior.
def validate_title(self, length: int) -> None:
servicex/databinder_models.py:150
- New branching logic for
length is Noneand the server-driven path should be covered by unit tests, including edge cases around the 128- and server-provided limits.
if length is None:
servicex/servicex_adapter.py:82
- The
_sample_title_limitattribute is never used. Consider either caching the parsed limit in this field or removing it to avoid an unused attribute.
self._sample_title_limit: Optional[int] = None
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #614 +/- ##
==========================================
+ Coverage 96.47% 96.50% +0.02%
==========================================
Files 29 29
Lines 1960 1974 +14
==========================================
+ Hits 1891 1905 +14
Misses 69 69
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - there is one place where I think the code could be a little more defensive. And my standard issue with deliver not having a async version, which means everything has to be make_sync.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Release 3.2.0 will not protect against submissions of too long sample names to pre-1.7.0 servers. Use a proper mechanism to determine whether the server should be able to handle long names.