Skip to content

Conversation

@BenGalewsky
Copy link
Contributor

For consistency sake, the enum was changed to root, however this is not what the server expects. To fix this we keep the enum key root, but make the string representation root-file. Added a unit test to verify this along with a pointer to the statement in the ServiceX client which sets up the valid values for this field

…ed value in the service.

For consistency sake, the enum was changed to root, however this is not what the server expects. To fix
this we keep the enum key root, but make the string representation root-file. Added a unit test to verify
this along with a pointer to the statement in the ServiceX client which sets up the valid values for this field
@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (b7dea4e) 79.66% compared to head (0928aa8) 79.70%.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           servicex_client     #324      +/-   ##
===================================================
+ Coverage            79.66%   79.70%   +0.03%     
===================================================
  Files                   33       33              
  Lines                 1613     1616       +3     
===================================================
+ Hits                  1285     1288       +3     
  Misses                 328      328              
Flag Coverage Δ
unittests 79.70% <100.00%> (+0.03%) ⬆️

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

Files Coverage Δ
servicex/models.py 98.64% <100.00%> (ø)
tests/test_servicex_adapter.py 100.00% <100.00%> (ø)

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

Copy link

@alexander-held alexander-held left a comment

Choose a reason for hiding this comment

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

The following setup breaks for me with this update:

from servicex.dataset_identifier import FileListDataset
from servicex.servicex_client import ServiceXClient

sx = ServiceXClient(backend="uproot")
dataset_id = FileListDataset("root://eospublic.cern.ch//eos/opendata/atlas/OutreachDatasets/2020-01-22/4lep/MC/mc_345060.ggH125_ZZ4lep.4lep.root")
ds = (sx
      .func_adl_dataset(dataset_id, codegen="uproot", title="Root", result_format="root")
      .set_tree("mini")
)
files_root = ds.Select(lambda e: {'lep_pt': e['lep_pt']}).Where(lambda e: e['lep_pt'] > 1000).as_files()

via

pydantic.error_wrappers.ValidationError: 1 validation error for TransformRequest
result-format
  value is not a valid enumeration member; permitted: 'parquet', 'root-file' (type=type_error.enum; enum_values=[<ResultFormat.parquet: 'parquet'>, <ResultFormat.root: 'root-file'>])

result_format=ResultFormat.root works, as does result_format="root-file" (the older version?).

edit: I did not read the description properly, so the "root-file" string representation is expected. I believe it is quite convenient to be able to use the string representation, but confusing if that cannot also be "root".

@BenGalewsky BenGalewsky merged commit b789933 into servicex_client Nov 16, 2023
@BenGalewsky BenGalewsky deleted the root-file branch November 16, 2023 16:48
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.

3 participants