Skip to content

Conversation

clayandgen
Copy link
Contributor

The following get_object lookups have been tested with Minio and AWS S3:

**PYTHON**
from openc3.utilities.bucket import Bucket
client = Bucket.getClient()
response = client.get_object(bucket="config", key="DEFAULT/targets_modified/test.csv", range="bytes=1-10")
print(response["Body"].read())

from openc3.utilities.bucket import Bucket
client = Bucket.getClient()
response = client.get_object(bucket="config", key="DEFAULT/targets_modified/test.csv")
print(response["Body"].read())
**RUBY**
client = OpenC3::Bucket.getClient
response = client.get_object(bucket: "config", key: "DEFAULT/targets_modified/test.csv", range: "bytes=1-10")
puts response.body.read

client = OpenC3::Bucket.getClient
response = client.get_object(bucket: "config", key: "DEFAULT/targets_modified/test.csv")
puts response.body.read

@clayandgen clayandgen requested review from jmthomas and ryanmelt June 24, 2025 15:41
Copy link

codecov bot commented Jun 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.18%. Comparing base (2e02fa7) to head (50b8864).
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2161      +/-   ##
==========================================
+ Coverage   80.17%   80.18%   +0.01%     
==========================================
  Files         636      636              
  Lines       47604    47604              
  Branches      754      754              
==========================================
+ Hits        38166    38171       +5     
+ Misses       9355     9350       -5     
  Partials       83       83              
Flag Coverage Δ
python 83.74% <ø> (+0.04%) ⬆️
ruby-api 84.70% <ø> (ø)
ruby-backend 82.89% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -118,15 +118,15 @@ def delete(self, bucket):
if self.exist(bucket):
self.client.delete_bucket(Bucket=bucket)

def get_object(self, bucket, key, path=None):
def get_object(self, bucket, key, path=None, range=""):
Copy link
Member

Choose a reason for hiding this comment

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

Should range = "" or None?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Passing Range=None to python Boto3 causes an error, so defaulting to a string here

Copy link

@clayandgen clayandgen merged commit 39fed5d into main Jun 30, 2025
28 of 29 checks passed
@clayandgen clayandgen deleted the feature/bucket-range branch June 30, 2025 21:40
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.

3 participants