ssl-hep / ServiceX_frontend

Client access library for ServiceX
https://servicex-frontend.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
5 stars 11 forks source link

`ResultFormat` should be removed #447

Closed gordonwatts closed 1 month ago

gordonwatts commented 2 months ago

The servicex package still exports ResultFormat, which is an enum defined in the models.py file. I suspect other things like ResultDesitination need to also be removed.

gordonwatts commented 2 months ago

Original error - before I figured out what was going on here.

The OutputFormat here fails with an error:

        General=sx.General(
            Codegen=query[1],
            # OutputFormat="root-ttree",  # type: ignore
            OutputFormat=sx.ResultFormat.root_ttree,  # Fails with error
            Delivery=("LocalCache" if download else "SignedURLs"),  # type: ignore
        ),

and the error:

pydantic_core._pydantic_core.ValidationError: 2 validation errors for General
OutputFormat
  Input should be 'parquet' or 'root-ttree' [type=enum, input_value=<ResultFormat.root_ttree: 'root-file'>, input_type=ResultFormat]
    For further information visit https://errors.pydantic.dev/2.9/v/enum

Note that the commented-out OutputFormat setting using a string works fine.

ponyisi commented 1 month ago

So this is technically an incompatible change with 3.0.0, but as Gordon points out 3.0.0 will fail if you attempt to use ResultFormat for ROOT files, so I think it's safe to make the change. I propose to export General.OutputFormatEnum as servicex.OutputFormat.