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

Rename file_infos parameter #397

Merged
merged 10 commits into from
Jun 15, 2023
Merged

Rename file_infos parameter #397

merged 10 commits into from
Jun 15, 2023

Conversation

mjurbanski-reef
Copy link
Collaborator

No description provided.

Comment on lines 31 to 58
@_file_infos_rename
def upload_bytes(
self,
data_bytes,
file_name,
content_type=None,
file_info: dict | None = None,
progress_listener=None,
encryption: v3.EncryptionSetting | None = None,
file_retention: v3.FileRetentionSetting | None = None,
legal_hold: v3.LegalHold | None = None,
large_file_sha1: Sha1HexDigest | None = None,
custom_upload_timestamp: int | None = None,
cache_control: str | None = None,
):
return super().upload_bytes(
data_bytes=data_bytes,
file_name=file_name,
content_type=content_type,
file_info=file_info,
progress_listener=progress_listener,
encryption=encryption,
file_retention=file_retention,
legal_hold=legal_hold,
large_file_sha1=large_file_sha1,
custom_upload_timestamp=custom_upload_timestamp,
cache_control=cache_control,
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@_file_infos_rename
def upload_bytes(
self,
data_bytes,
file_name,
content_type=None,
file_info: dict | None = None,
progress_listener=None,
encryption: v3.EncryptionSetting | None = None,
file_retention: v3.FileRetentionSetting | None = None,
legal_hold: v3.LegalHold | None = None,
large_file_sha1: Sha1HexDigest | None = None,
custom_upload_timestamp: int | None = None,
cache_control: str | None = None,
):
return super().upload_bytes(
data_bytes=data_bytes,
file_name=file_name,
content_type=content_type,
file_info=file_info,
progress_listener=progress_listener,
encryption=encryption,
file_retention=file_retention,
legal_hold=legal_hold,
large_file_sha1=large_file_sha1,
custom_upload_timestamp=custom_upload_timestamp,
cache_control=cache_control,
)
@_file_infos_rename
def upload_bytes(
self,
data_bytes,
file_name,
content_type=None,
file_info: dict | None = None,
progress_listener=None,
encryption: v3.EncryptionSetting | None = None,
file_retention: v3.FileRetentionSetting | None = None,
legal_hold: v3.LegalHold | None = None,
large_file_sha1: Sha1HexDigest | None = None,
custom_upload_timestamp: int | None = None,
cache_control: str | None = None,
*args,
**kwargs
):
return super().upload_bytes(
*args,
data_bytes=data_bytes,
file_name=file_name,
content_type=content_type,
file_info=file_info,
progress_listener=progress_listener,
encryption=encryption,
file_retention=file_retention,
legal_hold=legal_hold,
large_file_sha1=large_file_sha1,
custom_upload_timestamp=custom_upload_timestamp,
cache_control=cache_control,
**kwargs
)

Future-proofing - if someone adds an argument, we want it to be visible in v2 too and we do not want to rely on someone remembering it should be added here too.

@ppolewicz ppolewicz merged commit 1d2001c into Backblaze:master Jun 15, 2023
21 checks passed
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.

None yet

2 participants