Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/transform_request.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The General Section
^^^^^^^^^^^^^^^^^^^
The General section of the request includes the following fields:

* (Optional) ``OutputFormat``: Can be ``root-ttree`` (default) or ``parquet``
* (Optional) ``OutputFormat``: Can be ``root-ttree`` (default) or ``parquet`` (you can also use the enums ``servicex.OutputFormat.root_ttree`` and ``servicex.OutputFormat.parquet``)
* (Optional) ``Delivery``: Can be ``URLs`` or ``LocalCache`` (default)

In general, if you are running on your laptop away from the ServiceX site and are working with a small amount of
Expand Down
6 changes: 4 additions & 2 deletions servicex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from servicex.databinder_models import Sample, General, ServiceXSpec
from servicex.servicex_client import deliver
from .models import ResultFormat, ResultDestination
from .models import ResultDestination
import servicex.dataset as dataset
import servicex.query as query

OutputFormat = General.OutputFormatEnum

__all__ = [
"ResultFormat",
"OutputFormat",
"ResultDestination",
"Sample",
"General",
Expand Down
17 changes: 16 additions & 1 deletion tests/test_databinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from unittest.mock import patch
from pydantic import ValidationError

from servicex import ServiceXSpec, dataset
from servicex import ServiceXSpec, dataset, OutputFormat
from servicex.query_core import ServiceXException
from servicex.servicex_client import ReturnValueException
from servicex.dataset import FileList, Rucio
Expand Down Expand Up @@ -93,6 +93,21 @@ def test_list_of_root_files():
]


def test_output_format():
spec = basic_spec()
spec['General'] = {'OutputFormat': 'root-ttree'}
ServiceXSpec.model_validate(spec)
spec['General'] = {'OutputFormat': 'parquet'}
ServiceXSpec.model_validate(spec)
spec['General'] = {'OutputFormat': OutputFormat.root_ttree}
ServiceXSpec.model_validate(spec)
spec['General'] = {'OutputFormat': OutputFormat.parquet}
ServiceXSpec.model_validate(spec)
with pytest.raises(ValidationError):
spec['General'] = {'OutputFormat': 'root-tree'}
ServiceXSpec.model_validate(spec)


def test_rucio_did():
spec = ServiceXSpec.model_validate(
basic_spec(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dataset_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import pytest

from servicex import ResultFormat
from servicex.models import ResultFormat
from servicex.dataset_group import DatasetGroup
from servicex.query_core import ServiceXException

Expand Down
Loading