Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jj/klaijan/csv #200

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

Jj/klaijan/csv #200

wants to merge 17 commits into from

Conversation

Coniferish
Copy link
Collaborator

@Coniferish Coniferish commented Oct 25, 2024

Return text/csv when output_format=OutputFormat.TEXT_CSV

@@ -106,6 +107,7 @@ examples:
responses:
"200":
application/json: [{"type": "Title", "element_id": "6aa0ff22f91bbe7e26e8e25ca8052acd", "text": "LayoutParser: A Unified Toolkit for Deep Learning Based Document Image Analysis", "metadata": {"languages": ["eng"], "page_number": 1, "filename": "layout-parser-paper.pdf", "filetype": "application/pdf"}}]
text/csv: "<value>"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO: Figure out how to get the example from the openapi spec in here

@@ -8,4 +8,5 @@
| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation |
| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
| `csv_elements` | *Optional[str]* | :heavy_minus_sign: | Successful Response |
| `elements` | List[Dict[str, *Any*]] | :heavy_minus_sign: | Successful Response |
Copy link
Collaborator Author

@Coniferish Coniferish Oct 25, 2024

Choose a reason for hiding this comment

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

Q: elements isn't displayed as optional, but response.elements is None when csv_elements is returned.

@@ -74,6 +74,8 @@ class PartitionResponseTypedDict(TypedDict):
r"""HTTP response status code for this operation"""
raw_response: httpx.Response
r"""Raw HTTP response; suitable for custom response parsing"""
csv_elements: NotRequired[str]
r"""Successful Response"""
elements: NotRequired[List[Dict[str, Any]]]
r"""Successful Response"""

Copy link
Collaborator Author

@Coniferish Coniferish Oct 25, 2024

Choose a reason for hiding this comment

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

NTS: elements is listed as NotRequired/Optional

@Coniferish Coniferish requested a review from Klaijan November 19, 2024 02:39
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.

2 participants