Skip to content

Conversation

@laurence-kobold
Copy link
Contributor

Fixes #251

In fab6011, the S3 multipart-upload was changed. This meant that the writer was passed the result of get_mpu_kwargs, rather than the remaining kwargs passed to upload. This, in turn, meant that the writer was passing the result of get_mpu_kwargs when calling initiate, leading to them being passed to S3 API call.

This PR prevents the result of get_mpu_kwargs from being passed to initiate, fixing the S3 API call

@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

❌ Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.21%. Comparing base (0e02b0b) to head (e61d6fe).

Files with missing lines Patch % Lines
odc/geo/cog/_s3.py 25.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #252   +/-   ##
========================================
  Coverage    94.21%   94.21%           
========================================
  Files           34       34           
  Lines         5875     5875           
========================================
  Hits          5535     5535           
  Misses         340      340           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@SpacemanPaul SpacemanPaul left a comment

Choose a reason for hiding this comment

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

We need to get pylint and mypy passing.


def initiate(self, **kw) -> str:
def initiate(self) -> str:
"""Initiate the S3 multipart upload."""
Copy link
Contributor

Choose a reason for hiding this comment

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

This breaks the type signature established by the base class. I'm not that familiar with this part of the code but could we leave either:

  • leave **kw in the signature, and just not pass it on to s3.create_multipart_upload() below, OR
  • revert the changes in initiate all together and just not pass the kwargs to initiate below, in _ensure_init()?

Copy link
Member

Choose a reason for hiding this comment

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

NO, we can't just disable configuration of s3.multi_part_upload (original commit using blame: ee72392 clearly shows it was done for a reason), we just need to fix changes linked in the initial description (fab6011) to make sure that only parameters meant for boto make it to boto and others are forwarded to the appropriate place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 sounds good. I found the existing code a little confusing because currently none of the **kw arguments are being used to configure s3.create_multipart_upload. I've reversed my original changes and I now filter kwargs to only pass in parameters if they are in the signature

Copy link
Member

Choose a reason for hiding this comment

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

I feel like the error needs to be fixed higher in the call-stack. BTW @laurence-kobold how are you calling this, your original issue didn't include the call that errors out.

Copy link
Contributor Author

@laurence-kobold laurence-kobold Oct 27, 2025

Choose a reason for hiding this comment

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

I'm calling save_cog_with_dask(data, str(tiff_path), compression="deflate").compute()

@SpacemanPaul SpacemanPaul merged commit 43aa278 into opendatacube:develop Dec 9, 2025
2 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.

save_cog_with_dask failing to write to S3 due to ParamValidationError

3 participants