Skip to content

Selection of choice type provides unsatisfactory error message #2486

@johngrimes

Description

@johngrimes

The following code:

result = data.view(
    resource="Observation",
    select=[
        {
            "column": [
                {"path": "effective", "name": "effective"},
            ]
        }
    ]
)

result.show()

Provides the following error message:

  File "/Users/gri306/Code/pathling/lib/python/pathling/datasource.py", line 105, in view
    return self._wrap_df(jquery.execute())
                         ^^^^^^^^^^^^^^^^
  File "/Users/gri306/Code/pathling-scripts/.venv/lib/python3.12/site-packages/py4j/java_gateway.py", line 1322, in __call__
    return_value = get_return_value(
                   ^^^^^^^^^^^^^^^^^
  File "/Users/gri306/Code/pathling-scripts/.venv/lib/python3.12/site-packages/pyspark/errors/exceptions/captured.py", line 185, in deco
    raise converted from None
pyspark.errors.exceptions.captured.IllegalArgumentException: Must have a fhirType or a definition

I would expect this to say something more like: "Selection of mixed collection not supported: effective".

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions