Skip to content

Conversation

@ponyisi
Copy link
Collaborator

@ponyisi ponyisi commented Jul 4, 2025

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.

Copy link
Contributor

Copilot AI left a 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_NNNN capabilities
  • 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 length parameter can be None in the fallback case, so the annotation should be Optional[int] to match the actual behavior.
    def validate_title(self, length: int) -> None:

servicex/databinder_models.py:150

  • New branching logic for length is None and 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_limit attribute 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
Copy link

codecov bot commented Jul 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.50%. Comparing base (7e1621d) to head (6e1986e).
Report is 1 commits behind head on master.

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              
Flag Coverage Δ
unittests 96.50% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@gordonwatts gordonwatts left a 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.

Copy link
Contributor

@BenGalewsky BenGalewsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@BenGalewsky BenGalewsky merged commit c83fd4a into master Jul 9, 2025
37 checks passed
@BenGalewsky BenGalewsky deleted the sample-length-capability branch July 9, 2025 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants