Skip to content

Handle server API differences in file response fields#40

Open
rdenham wants to merge 2 commits into
WEHI-ResearchComputing:mainfrom
rdenham:type_error
Open

Handle server API differences in file response fields#40
rdenham wants to merge 2 commits into
WEHI-ResearchComputing:mainfrom
rdenham:type_error

Conversation

@rdenham
Copy link
Copy Markdown

@rdenham rdenham commented May 30, 2026

  • Some FileSender servers (observed on AARNet's instance, filesender.aarnet.edu.au) return the per-file upload key
    as puid rather than uid. Added a helper that resolves whichever field is present, with a clear error if neither is
    found.
  • The same servers return numeric fields such as file.size as strings in the JSON response. Added int() casts at the
    two arithmetic sites where this caused a TypeError.
  • Updated response_types.File to mark both uid and puid as NotRequired to reflect the server version difference.

Some FileSender servers (observed on AARNet's instance) return numeric
fields as strings and use 'puid' instead of 'uid' as the per-file upload
key. Cast size to int before arithmetic and resolve the key field from
whichever of uid/puid is present.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rdenham
Copy link
Copy Markdown
Author

rdenham commented May 30, 2026

I've also changed the download file, so all the encryption fields are optional. Actually, it should be noted that encryption doesn't work with this package, so you won't be able to download encrypted files anyway. I don't use encryption, so I think it is still worth fixing so that we can upload/download unencrypted files.

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.

1 participant