Alation / Allie-SDK

A Python library for the Alation REST APIs.
https://alation.github.io/Allie-SDK/
Apache License 2.0
9 stars 2 forks source link

Get Documents without ID causes error #29

Closed diethard-at-alation closed 2 months ago

diethard-at-alation commented 2 months ago

If you try to retrieve documents without id using the values parameter:

alation.document.get_documents(
        allie.DocumentParams(
            values = "title,description"
        )
)

... currently this call fails because the id is not returned:

File "/Users/ds/allie_sdk/methods/document.py", line 40, in <listcomp>
    documents_checked = [Document.from_api_response(document) for document in documents]
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ds/allie_sdk/core/data_structures.py", line 18, in from_api_response
    return cls(**{
           ^^^^^^^
TypeError: Document.__init__() missing 1 required keyword-only argument: 'id'

Required change: In the data model, make the id optional.