Skip to content

Revert overrides#177

Draft
Raytesnel wants to merge 2 commits intomainfrom
revert-overrides
Draft

Revert overrides#177
Raytesnel wants to merge 2 commits intomainfrom
revert-overrides

Conversation

@Raytesnel
Copy link
Collaborator

@Raytesnel Raytesnel commented Mar 10, 2026

PoC of how to multipart requests, team up with @cfs-data

what i have learned so far:

  • formdata is used as a flat dictionary. so pydantic inherentance is not working nicely here.
  • mixing dataclasses with pydantic models is also not helping. (striation/impression parameters dataclass)
  • when having only Form() in the input as pydantic model, and the FileUpload / File() in the same pydantic model looks like resolving the openAPI render issue. (see image) this will put it as parameters as a Form(). so far looking good.
image

to investigate

  • works bytes also instead of UploadFile
  • how to handle the not flat pydantic models?
  • conversion of mark_type is not working as expected: mark_type Value error, chamber impression mark is not a striation mark [type=value_error, input_value=<MarkType.CHAMBER_IMPRESS...hamber impression mark'>, input_type=MarkType]

lowpass_cutoff: float | None = 5.0e-6
highpass_regression_order: int = 2
lowpass_regression_order: int = 0
mask_data: UploadFile = File()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since the mask should fit in memory, use bytes here as typing instead of UploadFile to avoid the file system spooling in starlette

Copy link
Collaborator

Choose a reason for hiding this comment

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

(also in the other places)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yhea i changed it so it follows more the repo of my old project. (and it works till now) later if we fixed the last issue we can trim one for one till it bytes again i think

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